Skip to content

PairGrid subplot axis label not showing #3094

Answered by mwaskom
luzclasil asked this question in Q&A
Discussion options

You must be logged in to vote

You'll want to do something like this

import itertools
import seaborn as sns
import matplotlib.pyplot as plt

iris = sns.load_dataset("iris")

g = sns.PairGrid(iris, despine=False, diag_sharey=False)
g.map(plt.scatter)
for i, ax_row in enumerate(g.axes):
    for j, ax in enumerate(ax_row):
        ax.set_xlabel(g.x_vars[j], visible=True)
        ax.set_ylabel(g.y_vars[i], visible=True)
g.tight_layout()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@luzclasil
Comment options

Answer selected by luzclasil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3092 on October 18, 2022 10:38.