How to enable the top and right spines of a FacetGrid

101 Views Asked by At

I tried using sns.set_style("white"), but the spines only cover the bottom and left side. How can I set the spines all around the figure?

I also tried plt.subplots_adjust(right=0.1, top=0.1) to see if the spines were just hidden by the size, but I got a message that left and bottom needs to be bigger than right and top.

1

There are 1 best solutions below

0
mwaskom On

The underlying FacetGrid automatically "despines" its figures, but you can disable this behavior using the facet_kws parameter:

import seaborn as sns
df = sns.load_dataset("titanic")
sns.catplot(data=df, x="age", y="class", facet_kws={"despine": False})

enter image description here