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.
This commit is contained in:
parent
fbc19df6fb
commit
95ca9542e7
|
|
@ -104,7 +104,8 @@ def view_annotations(
|
||||||
|
|
||||||
ax.set_title(title, fontsize=title_fontsize, pad=20)
|
ax.set_title(title, fontsize=title_fontsize, pad=20)
|
||||||
ax.set_xlabel("Time (s)", fontsize=12)
|
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)
|
ax.grid(alpha=0.1)
|
||||||
|
|
||||||
output_path, _ = set_path(output_path=output_path)
|
output_path, _ = set_path(output_path=output_path)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user