-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Should points with a single infinite coordinate be masked or clipped? #10452
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 that infinities should be treated as invalid for plotting purposes, and therefore they should be masked. Building in special treatment for |
If I understand this proposal correctly you would want to add some vertical line from the last valid point towards infinity. So with this code
the result would be the following? That is hardly understandable. And you have no chance of knowing the user wanted to plot Next how about the margins? If the lines are clipped at the axes boundary, this effectively ignores the margin set. However, a margin is usually set precisely not to have the plot be tight to the boundaries. |
Most arguments have already been made in the linked issue, so I'm just giving the short version here.
I don't see how the margins are a problem, they would as always be computed ignoring the infinite points. |
The point about margins is not how they are calculated, but about the expected visual appearance. If I set some margin around the plot I would expect there to be no lines within this margin. The proposed change would counteract this expectation, because those infinity-line would appear in the plot in the region where I don't want to have any lines due to my setting of In that sense, whatever you do, just make sure to include the option to turn those infinity-lines off in the rcParams. |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
Let's close this as "unlikely to ever happen". |
Initially raised in #9305 (comment) (and following comment).
We realized in 2.1 that there is a reasonable argument for
plt.plot([1, 1], [1, np.inf])
to draw a semi-infinite vertical line andplt.plot([1, 1], [-np.inf, np.inf])
to draw an infinite vertical line by default (by having the renderer clip infinities instead of masking them). Right now log scale allows both clipping and masking behavior, but linear scale always masks.Of course this is a breaking change, so I'm just opening this for discussion.
The text was updated successfully, but these errors were encountered: