-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Secondary axis called with [0, 1] might produce exceptions in case these are invalid data #14270
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
Comments
I think the 0-1 invalid values problem is mostly fixed by #13593 (already merged), although there are some subsequent problems:
results in So I think at that point (in master) it's more a datetime handling problem (well, I don't know enough about datetime handling to really judge) rather than a secondary_axis problem. Perhaps(??) it would be nice to have a |
Sorry secondary_axis has some issues. Thanks for trying it out! I’m away from computer until next weekend so I can’t look at this right away. |
Btw. I found an easy solution, see: https://gist.github.com/MaxNoe/3deef353cf377245f28a04f32dee6ee8 Still, I think it's a bit surprising that functions get called with hard-coded 0, 1 |
Works if you specify |
I guess new axes have to be instantiated with some limits. But in this case I guess secondary axes should check the parent axes at least before it tries to get ticks etc. |
The [0, 1] thingy is gone on master, so I'll close this. Thx for the help. |
Ok but does it need to be backported to 3.1.x? |
I think #13593 is probably too big to backport to master, but maybe if there's not an easier fix to this problem we could? |
Given the scale of the backport that would be required, and that 3.2 is coming out soon, marking this as 3.2 and closing. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Transform functions for the new feature
secondary_xaxis
are always called with 0 and 1 atinstantiation, which might be invalid input for transformations.
Code for reproduction
E.g. trying to get a secondary axis showing mjd for a date axis
Results in:
Matplotlib version
The text was updated successfully, but these errors were encountered: