我正在使用matplotlib生成一些图表,我想要在轴刻度上有更大的字体,所以我使用了以下代码:
是否有任何方法可以控制mpatches.Patch()文本的大小?
font = {'size' : 22}
matplotlib.rc('font', **font)
这影响了我的图例大小,如下图所示:
![figure](https://istack.dev59.com/RJ4ge.webp)
font = {'size' : 22}
matplotlib.rc('font', **font)
这影响了我的图例大小,如下图所示:
mpatches.Patch()
没有字体大小,因为它没有与之相关联的文本。
To control the label's fontsize you can use rcParams, like
plt.rcParams["axes.labelsize"] = 22
or directly control the size of the label
ax.set_xlabel("some label", fontsize=22)
To control the legend's fontsize you can use rcParams
plt.rcParams["legend.fontsize"] = 22
or directly specify the size in the legend
ax.legend(fontsize=22)
plot.legend(......,prop={'size':6})
,这样我就可以选择您的答案了。谢谢。 - elia