Compare commits
No commits in common. "viewfix" and "main" have entirely different histories.
|
|
@ -64,7 +64,7 @@ def view_annotations(
|
|||
annotations = recording.annotations
|
||||
|
||||
# 2. Setup Color Mapping
|
||||
palette = ["#2196F3", "#9C27B0", "#EAF4FE", "#7B1FA2", "#5C6BC0", "#CE93D8", "#1565C0", "#7C4DFF"]
|
||||
palette = ["#2196F3", "#9C27B0", "#64B5F6", "#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)}
|
||||
|
||||
|
|
@ -102,14 +102,13 @@ def view_annotations(
|
|||
]
|
||||
ax.legend(handles=legend_elements, loc="upper right", framealpha=0.2)
|
||||
|
||||
ax.set_title(title, fontsize=title_fontsize, pad=14)
|
||||
ax.set_title(title, fontsize=title_fontsize, pad=20)
|
||||
ax.set_xlabel("Time (s)", fontsize=12)
|
||||
ax.set_ylabel("Frequency (MHz)", fontsize=12)
|
||||
ax.yaxis.set_major_formatter(ticker.FuncFormatter(lambda y, _: f"{y / 1e6:.1f}"))
|
||||
ax.grid(alpha=0.1)
|
||||
|
||||
output_path, _ = set_path(output_path=output_path)
|
||||
plt.savefig(output_path, dpi=dpi, bbox_inches="tight", pad_inches=0.2)
|
||||
plt.savefig(output_path, dpi=dpi, bbox_inches="tight")
|
||||
plt.close(fig)
|
||||
print(f"Professional annotation plot saved to {output_path}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user