Skip to content

Commit

Permalink
Rename an internal parameter of _label_outer_x/yaxis()
Browse files Browse the repository at this point in the history
`check_patch` does not explain what this parameter is achieving.
  • Loading branch information
timhoffm committed Aug 4, 2023
1 parent d073a36 commit 456ae86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions lib/matplotlib/axes/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4498,12 +4498,12 @@ def label_outer(self):
labels are on the top side); y-labels only for subplots on the first
column (or last column, if labels are on the right side).
"""
self._label_outer_xaxis(check_patch=False)
self._label_outer_yaxis(check_patch=False)
self._label_outer_xaxis(skip_non_rectangular_axes=False)
self._label_outer_yaxis(skip_non_rectangular_axes=False)

def _label_outer_xaxis(self, *, check_patch):
def _label_outer_xaxis(self, *, skip_non_rectangular_axes):
# see documentation in label_outer.
if check_patch and not isinstance(self.patch, mpl.patches.Rectangle):
if skip_non_rectangular_axes and not isinstance(self.patch, mpl.patches.Rectangle):
return
ss = self.get_subplotspec()
if not ss:
Expand All @@ -4522,9 +4522,9 @@ def _label_outer_xaxis(self, *, check_patch):
if self.xaxis.offsetText.get_position()[1] == 0:
self.xaxis.offsetText.set_visible(False)

def _label_outer_yaxis(self, *, check_patch):
def _label_outer_yaxis(self, *, skip_non_rectangular_axes):
# see documentation in label_outer.
if check_patch and not isinstance(self.patch, mpl.patches.Rectangle):
if skip_non_rectangular_axes and not isinstance(self.patch, mpl.patches.Rectangle):
return
ss = self.get_subplotspec()
if not ss:
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ def subplots(self, *, sharex=False, sharey=False, squeeze=True,
# turn off redundant tick labeling
if sharex in ["col", "all"]:
for ax in axarr.flat:
ax._label_outer_xaxis(check_patch=True)
ax._label_outer_xaxis(skip_non_rectangular_axes=True)
if sharey in ["row", "all"]:
for ax in axarr.flat:
ax._label_outer_yaxis(check_patch=True)
ax._label_outer_yaxis(skip_non_rectangular_axes=True)

if squeeze:
# Discarding unneeded dimensions that equal 1. If we only have one
Expand Down

0 comments on commit 456ae86

Please sign in to comment.