-
Notifications
You must be signed in to change notification settings - Fork 930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Physical units in specshow
axis labels
#1819
Comments
This is a little subtle, but I think the behavior here is intended at least for time-like axes. From the code excerpt you cite, we do add physical units when they're explicitly specified. When the formatting is implicit and automatic, this can get dicey: would it make sense for ticks like The other part of your description, frequency-like axes, is probably worth looking into. On the one hand, I do think it's clear enough as is, and it's easy for a user to modify things after the fact if they want more detail. On the other hand, good default behavior is good. 😁 Frequency-like axes are not obvious, however. For example, pretty much anything we label with Hz can also be labeled as That's all to say: I'm not sure what (if anything) we should do here. Curious for thoughts though. |
Thank you @bmcfee for having read me.
You guessed it: this came out while looking into #1746, in the context of visualizing long-duration bioacoustic signals.
Thanks ... another frustration i often have is that there's no support for
For me, no label at all is fine in this case. I don't need a label to know that
Yes OK with just BPM. You're right, this one is perfectly clear as is, and that's an inconsistency i'm happy to live with. Sorry for all the dissent and i hope we manage to resolve this! |
Right, but the trouble here is that with automatic formatting, the units can change depending on the scale of the viewport, so the xlabel would have to be updated after limit changes. Doing this properly would require an axis callback. I'm not opposed to that in principle - we already do this for waveshow - but there's a problem with matplotlib currently that only one callback at a time per event is supported. I do think our formatting is unambiguous though:
That's a good point. I wonder if there's an elegant way to mix in frequency unit scaling with our existing axis formatters? Having a splat of
Agreed, though I think it's worth including for consistency (decorated axes always get labels). |
Is your feature request related to a problem? Please describe.
Today i was looking at our (lesser-known!) gallery of advanced examples
https://librosa.org/doc/main/advanced.html
and noticed that the x-axis says "Time" without physical unit.
Meanwhile, the y-axis gives the physical unit (
Hz
) but not the quantity ("Frequency"
).The same is true for tempograms. The axis says
BPM
notTempo (BPM)
.Describe the solution you'd like
It would be good to have consistency through the examples and documentation on how to label axes.
Describe alternatives you've considered
Calling
xlabel
,ylabel
manually afterspecshow
.Additional context
Here's (an excerpt) of
__decorate_axis
:Related: #1364 #1746
The text was updated successfully, but these errors were encountered: