Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d13b2d

Browse files
committed
Force autoscaling immediately after setting a scale.
1 parent cf2ef39 commit 9d13b2d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,7 +3252,6 @@ def set_xscale(self, value, **kwargs):
32523252
- `matplotlib.scale.SymmetricalLogScale`
32533253
- `matplotlib.scale.LogitScale`
32543254
3255-
32563255
Notes
32573256
-----
32583257
By default, Matplotlib supports the above mentioned scales.
@@ -3265,7 +3264,9 @@ def set_xscale(self, value, **kwargs):
32653264
ax.xaxis._set_scale(value, **kwargs)
32663265
ax._update_transScale()
32673266
ax.stale = True
3268-
self._request_autoscale_view(scaley=False)
3267+
# Force autoscaling now, to take advantage of the scale locator's
3268+
# nonsingular() before it possibly gets swapped out by the user.
3269+
self.autoscale_view(scaley=False)
32693270

32703271
@cbook._make_keyword_only("3.2", "minor")
32713272
def get_xticks(self, minor=False):
@@ -3637,7 +3638,6 @@ def set_yscale(self, value, **kwargs):
36373638
- `matplotlib.scale.SymmetricalLogScale`
36383639
- `matplotlib.scale.LogitScale`
36393640
3640-
36413641
Notes
36423642
-----
36433643
By default, Matplotlib supports the above mentioned scales.
@@ -3650,7 +3650,9 @@ def set_yscale(self, value, **kwargs):
36503650
ax.yaxis._set_scale(value, **kwargs)
36513651
ax._update_transScale()
36523652
ax.stale = True
3653-
self._request_autoscale_view(scalex=False)
3653+
# Force autoscaling now, to take advantage of the scale locator's
3654+
# nonsingular() before it possibly gets swapped out by the user.
3655+
self.autoscale_view(scalex=False)
36543656

36553657
@cbook._make_keyword_only("3.2", "minor")
36563658
def get_yticks(self, minor=False):

0 commit comments

Comments
 (0)