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

Skip to content

Commit e897384

Browse files
committed
Remove unneeded _update_transScale calls in _init_axis.
_init_axis is called only in the Axes constructor, where it is followed by a call to clear, which itself already calls _update_transScale (which is needed to take into account the axis scales that get set in it). So _init_axis doesn't need to call _update_transScale itself. Removing it avoids showcasing a private method in the custom_projection demo, and helps moving towards a system where updating an axis scale directly invalidates whatever is necessary (e.g. via a TransformWrapper) instead of requiring manual invalidation calls (i.e. _update_transScale).
1 parent ccbd641 commit e897384

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

examples/misc/custom_projection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def _init_axis(self):
5050
# Do not register xaxis or yaxis with spines -- as done in
5151
# Axes._init_axis() -- until GeoAxes.xaxis.clear() works.
5252
# self.spines['geo'].register_axis(self.yaxis)
53-
self._update_transScale()
5453

5554
def clear(self):
5655
# docstring inherited

lib/matplotlib/axes/_base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ def _init_axis(self):
822822
self.yaxis = maxis.YAxis(self)
823823
self.spines.left.register_axis(self.yaxis)
824824
self.spines.right.register_axis(self.yaxis)
825-
self._update_transScale()
826825

827826
def set_figure(self, fig):
828827
# docstring inherited

lib/matplotlib/projections/geo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def _init_axis(self):
3535
# Do not register xaxis or yaxis with spines -- as done in
3636
# Axes._init_axis() -- until GeoAxes.xaxis.clear() works.
3737
# self.spines['geo'].register_axis(self.yaxis)
38-
self._update_transScale()
3938

4039
def clear(self):
4140
# docstring inherited

lib/matplotlib/projections/polar.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,11 +792,9 @@ def _init_axis(self):
792792
# This is moved out of __init__ because non-separable axes don't use it
793793
self.xaxis = ThetaAxis(self)
794794
self.yaxis = RadialAxis(self)
795-
# Calling polar_axes.xaxis.clear() or polar_axes.xaxis.clear()
796-
# results in weird artifacts. Therefore we disable this for
797-
# now.
795+
# Calling polar_axes.xaxis.clear() or polar_axes.yaxis.clear()
796+
# results in weird artifacts. Therefore we disable this for now.
798797
# self.spines['polar'].register_axis(self.yaxis)
799-
self._update_transScale()
800798

801799
def _set_lim_and_transforms(self):
802800
# A view limit where the minimum radius can be locked if the user

0 commit comments

Comments
 (0)