The concept of delaying autoscaling makes sense to me, although in the example above the meaning of scalex=False is not so intuitive to me -- I would think anything with scalex=False should be excluded from the autoscaling process in one way or another. Does that sound like a reasonable expectation?
I'm not sure -- it could be that I'm just accustomed to the previous behavior.
I guess what you really want is more along the lines of #15595?
In the meantime we could trigger an autoscale when scalex/scaley goes from True to False, i.e. in _request_autoscale_view, something like if self._stale_viewlim_x and not scalex or self._stale_viewlim_y and not scaley: self._unstale_viewlim()? (untested, but hopefully you get the idea...)
Just a little poke: this bug is still open. Whether or not it results from an intentional change in #13593, it's not reflected in the documentation.
scalex, scaleybool, default: True
These parameters determine if the view limits are adapted to the data limits. The values are passed on to autoscale_view.
Good point. I think scalex/scaley should be deprecated in favor of #15595 once something like that gets in, but in the meantime the following seems to work OKish, going back to the old semantics:
diff --git i/lib/matplotlib/axes/_axes.py w/lib/matplotlib/axes/_axes.py
index 5369eadbde..2b08537ef1 100644
--- i/lib/matplotlib/axes/_axes.py+++ w/lib/matplotlib/axes/_axes.py@@ -1719,6 +1719,8 @@ class Axes(_AxesBase):
additionally use any `matplotlib.colors` spec, e.g. full names
(``'green'``) or hex strings (``'#008000'``).
"""
+ if not scalex or not scaley:+ self._unstale_viewLim()
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
lines = [*self._get_lines(*args, data=data, **kwargs)]
for line in lines:
(note that using scalex/scaley=False then implies some runtime cost, as explained in 160de56)
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!
Activity
QuLogic commented on Jul 18, 2020
This comes from 160de56, or #13593. This may be an expected change; see the API note from that PR.
cc @anntzer
neilpeterman commented on Jul 18, 2020
Thanks for the clarification @QuLogic -- so the way to achieve the previous behavior would be to do something like this:
The concept of delaying autoscaling makes sense to me, although in the example above the meaning of scalex=False is not so intuitive to me -- I would think anything with scalex=False should be excluded from the autoscaling process in one way or another. Does that sound like a reasonable expectation?
I'm not sure -- it could be that I'm just accustomed to the previous behavior.
anntzer commented on Jul 18, 2020
I guess what you really want is more along the lines of #15595?
In the meantime we could trigger an autoscale when scalex/scaley goes from True to False, i.e. in _request_autoscale_view, something like if self._stale_viewlim_x and not scalex or self._stale_viewlim_y and not scaley: self._unstale_viewlim()? (untested, but hopefully you get the idea...)
neilpeterman commented on Jul 21, 2020
It seems like the fixes you bring up would address the issue in a reasonable way, triggering autoscaling when needed.
igurin-invn commented on May 29, 2023
Just a little poke: this bug is still open. Whether or not it results from an intentional change in #13593, it's not reflected in the documentation.
anntzer commented on Jun 3, 2023
Good point. I think scalex/scaley should be deprecated in favor of #15595 once something like that gets in, but in the meantime the following seems to work OKish, going back to the old semantics:
(note that using scalex/scaley=False then implies some runtime cost, as explained in 160de56)
igurin-invn commented on Jun 4, 2023
Is there a better workaround than this?
github-actions commented on Aug 3, 2026
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!