From 4f6320edc46f3ec02a6031cb7d6bf12be6bf3a4b Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 9 Sep 2016 10:14:57 -0700 Subject: [PATCH] label_outer() should remove inner minor ticks too. Minimal example: fig, axs = plt.subplots(2, 2, sharex=True, sharey=True) axs[0, 0].set(xscale="log", yscale="log", xlim=(1, 10)) for ax in axs: ax.label_outer() Also, do not switch back on visibility of outer offset text if it was not visible before. --- lib/matplotlib/axes/_subplots.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/axes/_subplots.py b/lib/matplotlib/axes/_subplots.py index 47f3c15749d..d2fdb6cfdc7 100644 --- a/lib/matplotlib/axes/_subplots.py +++ b/lib/matplotlib/axes/_subplots.py @@ -134,15 +134,15 @@ def label_outer(self): """ lastrow = self.is_last_row() firstcol = self.is_first_col() - for label in self.get_xticklabels(): - label.set_visible(lastrow) - self.get_xaxis().get_offset_text().set_visible(lastrow) if not lastrow: + for label in self.get_xticklabels(which="both"): + label.set_visible(False) + self.get_xaxis().get_offset_text().set_visible(False) self.set_xlabel("") - for label in self.get_yticklabels(): - label.set_visible(firstcol) - self.get_yaxis().get_offset_text().set_visible(firstcol) if not firstcol: + for label in self.get_yticklabels(which="both"): + label.set_visible(False) + self.get_yaxis().get_offset_text().set_visible(False) self.set_ylabel("") def _make_twin_axes(self, *kl, **kwargs):