Vicki B
Vicki B

Reputation: 584

Changing font size for Seaborn pairplot

I have created a scatter matrix using pandas, in a Jupyter notebook. It's a 12x12 matrix, so it takes up a lot of space and, therefore, the x- and y- ticks and labels are quite small.

I found code to increase the size for pandas' scatter_matix.

from pandas.plotting import scatter_matrix

Axes = scatter_matrix(df, figsize=(14, 14), diagonal='kde')
#y ticklabels
[plt.setp(item.yaxis.get_majorticklabels(), 'size', 7) for item in Axes.ravel()]
#x ticklabels 
# ...

#y labels
[plt.setp(item.yaxis.get_label(), 'size', 10) for item in Axes.ravel()]

I want to compare the same plot in Seaborn

grid = sns.pairplot(df,  diag_kind='kde')

but I can't figure out how to change the font sizes. I can't call ravel on a PairGrid. Is there something similar?

I've been looking at possible posts here in S.O. but nothing seems to work.

Is here a Seaborn equivalent to

[plt.setp(item.yaxis.get_label(), 'size', 10) for item in Axes.ravel()]

enter image description here

Upvotes: 2

Views: 5276

Answers (1)

daisy
daisy

Reputation: 81

Default is 1, can change to bigger scale.

sns.set_theme(font_scale=val)

Upvotes: 2

Related Questions