Reputation: 4407
My question is how to change the size of font in seaborn using correlation matrix I don't know why somehow the font is too large for me
Upvotes: 5
Views: 14894
Reputation: 1
Use the following as one of the parameters in seaborn.heatmap()
:
annot_kws={'size':12}
Upvotes: 0
Reputation: 53
i did this at this works quite well.
sns.set(style="white")
f, ax = plt.subplots(figsize=(20, 20))
sns.heatmap(bos.corr(),annot=True,annot_kws={"size":15})
Upvotes: 1
Reputation: 1403
I believe you can use the set method, modify the font scale parameter.
sns.set(font_scale=0.5)
Upvotes: 2
Reputation: 3797
if you already have the correlation values in your data, you can use a heatmap and set up the size with "annot_kws", for example here setting it to 8.
sns.heatmap(data, vmin=data.values.min(), vmax=1, square=True,
linewidths=0.1, annot=True, annot_kws={"size":8})
and it would look like this:
Upvotes: 13
Reputation: 11
If you're using set_context, then you can add a font scaling parameter along with the size of the plot.
sns.set_context("poster",font_scale=.7)
Upvotes: 1
Reputation: 49002
Regrettably I don't think that's configurable, but what I would recommend is just to make the figure larger e.g.
f, ax = plt.subplots(figsize=(10, 10))
sns.corrplot(df, ax=ax)
If that's not an option and you're primarily interested in the heatmap (not the numerical values), you could do
sns.corrplot(df, annot=False, sig_stars=False, diag_names=False)
Upvotes: 2