-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Raise error if argument to xlim is invalid, e.g., nan #7460
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
So your suggestion is to raise an error? |
(I'd raise an error…) |
That seems to be 1.5 votes to error. |
Make that 2.5. |
I'm fine with making it an error too. Same with |
Yes. Sounds like an |
xlim(left=np.nan, right=...)
be synonymous to xlim(left=None, right=...)
Working on this now. It looks like Do we need the full |
I think you can handle that by putting the check after the calls to |
We now have 3 PRs for this! |
Fixed Issue #7460: Raised an error if argument to xlim is invalid
As of 2.0b4, passing
nan
as a limit toxlim
seems to reset both limits to(-0.001, 0.001)
(try e.g. withplt.plot([0, 1]); plt.xlim(right=np.nan)
). I think this should either error, or, more usefully, be interpreted as None (i.e. leave that limit as is). (For extra points, we can also bikeshed what passinginf
toxlim
should mean.)The main use case would be when the
xlim
is read from some float context (e.g. from an array) where you can easily storenan
but notNone
.The text was updated successfully, but these errors were encountered: