Skip to content

Commit e883f43

Browse files
authored
Merge pull request #24653 from anntzer/cbs
Directly call _long_axis()._set_axes_scale in Colorbar.
2 parents 7aaf814 + 095151c commit e883f43

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/matplotlib/colorbar.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import matplotlib.artist as martist
2121
import matplotlib.patches as mpatches
2222
import matplotlib.path as mpath
23-
import matplotlib.scale as mscale
2423
import matplotlib.spines as mspines
2524
import matplotlib.transforms as mtransforms
2625
from matplotlib import _docstring
@@ -393,7 +392,6 @@ def __init__(self, ax, mappable=None, *, cmap=None,
393392
self._minorlocator = None
394393
self._formatter = None
395394
self._minorformatter = None
396-
self.__scale = None # linear, log10 for now. Hopefully more?
397395

398396
if ticklocation == 'auto':
399397
ticklocation = _get_ticklocation_from_orientation(
@@ -1029,14 +1027,7 @@ def _set_scale(self, scale, **kwargs):
10291027
`matplotlib.scale.register_scale`. These scales can then also
10301028
be used here.
10311029
"""
1032-
if self.orientation == 'vertical':
1033-
self.ax.set_yscale(scale, **kwargs)
1034-
else:
1035-
self.ax.set_xscale(scale, **kwargs)
1036-
if isinstance(scale, mscale.ScaleBase):
1037-
self.__scale = scale.name
1038-
else:
1039-
self.__scale = scale
1030+
self._long_axis()._set_axes_scale(scale, **kwargs)
10401031

10411032
def remove(self):
10421033
"""

0 commit comments

Comments
 (0)