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

Skip to content

Commit 0a4866f

Browse files
authored
Merge pull request #23596 from oscargus/mplaxescleanup
Minor cleanup of axes_grid1
2 parents 1076a16 + da44daf commit 0a4866f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def _tick_only(ax, bottom_on, left_on):
2020
class CbarAxesBase:
2121
def __init__(self, *args, orientation, **kwargs):
2222
self.orientation = orientation
23-
self._default_label_on = True
2423
self._locator = None # deprecated.
2524
super().__init__(*args, **kwargs)
2625

@@ -33,7 +32,6 @@ def colorbar(self, mappable, *, ticks=None, **kwargs):
3332
return cb
3433

3534
def toggle_label(self, b):
36-
self._default_label_on = b
3735
axis = self.axis[self.orientation]
3836
axis.toggle(ticklabels=b, label=b)
3937

lib/mpl_toolkits/axes_grid1/mpl_axes.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,11 @@ def toggle(self, all=None, ticks=None, ticklabels=None, label=None):
112112
if label is not None:
113113
_label = label
114114

115-
tickOn = "tick%dOn" % self._axisnum
116-
labelOn = "label%dOn" % self._axisnum
117-
118115
if _ticks is not None:
119-
tickparam = {tickOn: _ticks}
116+
tickparam = {f"tick{self._axisnum}On": _ticks}
120117
self._axis.set_tick_params(**tickparam)
121118
if _ticklabels is not None:
122-
tickparam = {labelOn: _ticklabels}
119+
tickparam = {f"label{self._axisnum}On": _ticklabels}
123120
self._axis.set_tick_params(**tickparam)
124121

125122
if _label is not None:

0 commit comments

Comments
 (0)