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
Regrettably I don't think that's configurable, but what I would recommend is just to make the figure larger eg
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)
如果您正在使用set_context,则可以添加字体缩放参数以及绘图的大小。
sns.set_context("poster",font_scale=.7)
我相信你可以使用set方法,修改font scale参数。
sns.set(font_scale=0.5)
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})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.