Compare commits

...

2 Commits

Author SHA1 Message Date
478ac44825 fix: adjust title padding and save figure with additional padding in view_annotations 2026-07-14 15:26:18 -04:00
95ca9542e7 fix: display annotation frequency axis in MHz instead of raw Hz
Raw Hz values with the default scientific-notation formatter produced
a cluttered "1e9" axis offset. Format ticks in MHz via a FuncFormatter
instead, matching the other spectrogram views.
2026-07-14 15:16:28 -04:00

View File

@ -102,13 +102,14 @@ def view_annotations(
]
ax.legend(handles=legend_elements, loc="upper right", framealpha=0.2)
ax.set_title(title, fontsize=title_fontsize, pad=20)
ax.set_title(title, fontsize=title_fontsize, pad=14)
ax.set_xlabel("Time (s)", fontsize=12)
ax.set_ylabel("Frequency (Hz)", 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")
plt.savefig(output_path, dpi=dpi, bbox_inches="tight", pad_inches=0.2)
plt.close(fig)
print(f"Professional annotation plot saved to {output_path}")