-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[ENH]: Be able to ignore specific plots when autoscaling axes #29634
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
See #15595 and linked issues. |
I searched for a while before raising but clearly used the wrong keywords, as I didn't turn up those. Thanks for pointing me at them! |
Specifically for straight lines, you can use axline. |
Thanks @rcomer, I wasn't aware of |
I dont' see any reason something like #15595 could not go through. It just needs someone interested in the capability to implement it. |
The current architecture is somewhat messy, we probably need to clean that up first, but it should not be too hard #15595 (comment). |
Problem
When building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the Axes. If I'm using autoscaling, this doesn't happen because the scale adjusts to leave a margin around the new plots.
Currently, to avoid this, I need to do something like:
This means I am constrained in how I order my code—I have to have all my data contributing to autoscaling present before I add any fit lines. (This gets more complicated when I am working with multiple Axes with
sharex
orsharey
.)Example of what I might be looking for:
Example of what I currently get without the workaround above:
Proposed solution
Ideally, have a new keyword argument on
plot
and friends, something likeuse_in_autoscale: bool = True
. WhenTrue
, the object generated byplot
contributes to the axis limit computations as currently; whenFalse
, then it is ignored in these computations.The text was updated successfully, but these errors were encountered: