我如何更改 seaborn.displot 图形的 font-size?

How can i change the font-size of my seaborn.displot graphic?

我正在尝试更改 seaborn.displot.

中图形标题的 font-size

我有这个代码:

f = sns.displot(df,x="yearOfRegistration", kde=True, binwidth=5)
f.set(title = "Distribuição de Veículos com base no Ano de Registro")
f.set_axis_labels("Ano de Registro","Densidade (KDE)")

plt.show()

我的输出是:

ouput

所以,我尝试了这个:

f = sns.displot(df,x="yearOfRegistration", kde=True, binwidth=5)
f.set(title = "Distribuição de Veículos com base no Ano de Registro", font_size = 20)
f.set_axis_labels("Ano de Registro","Densidade (KDE)")

plt.show()

我有

"AttributeError: 'AxesSubplot' object has no property 'font_size'"

我查看了所有 seaborn 文档,但找不到解决方案。

谁能帮帮我? 谢谢!!

尝试使用pyplot:

from matplotlib import pyplot as plt

plt.title("Title", fontdict = {'fontsize': 20})