fix: correct annotation frequency label and tertiary annotation color

freq_lower_edge/freq_upper_edge are plain Hz values (no unit
conversion happens before plotting), so the axis was mislabeled
"Frequency (MHz)". Also lighten the palette's tertiary color, which
was nearly indistinguishable from the primary blue in the legend.
This commit is contained in:
G gillian 2026-07-14 14:31:11 -04:00
parent de03071c9b
commit fbc19df6fb

View File

@ -64,7 +64,7 @@ def view_annotations(
annotations = recording.annotations
# 2. Setup Color Mapping
palette = ["#2196F3", "#9C27B0", "#64B5F6", "#7B1FA2", "#5C6BC0", "#CE93D8", "#1565C0", "#7C4DFF"]
palette = ["#2196F3", "#9C27B0", "#EAF4FE", "#7B1FA2", "#5C6BC0", "#CE93D8", "#1565C0", "#7C4DFF"]
unique_labels = sorted(list(set(ann.label for ann in annotations if ann.label)))
label_to_color = {label: palette[i % len(palette)] for i, label in enumerate(unique_labels)}
@ -104,7 +104,7 @@ def view_annotations(
ax.set_title(title, fontsize=title_fontsize, pad=20)
ax.set_xlabel("Time (s)", fontsize=12)
ax.set_ylabel("Frequency (MHz)", fontsize=12)
ax.set_ylabel("Frequency (Hz)", fontsize=12)
ax.grid(alpha=0.1)
output_path, _ = set_path(output_path=output_path)