Skip to content

Commit

Permalink
Fix non-removed interior axis labels and diagonal legends in PairGrid (
Browse files Browse the repository at this point in the history
…#2637)

These were oversights from #2583
  • Loading branch information
mwaskom authored Aug 8, 2021
1 parent c20d910 commit bfb7a04
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions seaborn/axisgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,22 @@ def __init__(
self._legend_data = {}

# Make the plot look nice
for ax in axes[:-1, :].flat:
if ax is None:
continue
for label in ax.get_xticklabels():
label.set_visible(False)
ax.xaxis.offsetText.set_visible(False)
ax.xaxis.label.set_visible(False)

for ax in axes[:, 1:].flat:
if ax is None:
continue
for label in ax.get_yticklabels():
label.set_visible(False)
ax.yaxis.offsetText.set_visible(False)
ax.yaxis.label.set_visible(False)

self._tight_layout_rect = [.01, .01, .99, .99]
self._tight_layout_pad = layout_pad
self._despine = despine
Expand Down Expand Up @@ -1436,6 +1452,7 @@ def map_diag(self, func, **kwargs):
plot_kwargs.setdefault("hue_order", self._hue_order)
plot_kwargs.setdefault("palette", self._orig_palette)
func(x=vector, **plot_kwargs)
ax.legend_ = None

self._add_axis_labels()
return self
Expand Down

0 comments on commit bfb7a04

Please sign in to comment.