Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何为matplotlib轴标签设置自定义字体?_Matplotlib - Fatal编程技术网

如何为matplotlib轴标签设置自定义字体?

如何为matplotlib轴标签设置自定义字体?,matplotlib,Matplotlib,这会将轴标签更改为我想要的字体,但如何更改每个轴上的数字 import matplotlib.pyplot as plt prop = fm.FontProperties(fname='/Users/NAME/Downloads/GARA.ttf') sns.lineplot(x=stlr_df['Number of Steps'], y= stlr_df['Learning Rate'], color='purple') plt.xlabel('Number of Steps',fo

这会将轴标签更改为我想要的字体,但如何更改每个轴上的数字

import matplotlib.pyplot as plt

prop = fm.FontProperties(fname='/Users/NAME/Downloads/GARA.ttf')


sns.lineplot(x=stlr_df['Number of Steps'], y= stlr_df['Learning Rate'], color='purple')


plt.xlabel('Number of Steps',fontproperties=prop, size=14)
plt.ylabel('Learning Rate',fontproperties=prop, size=14)```


指定的
fontproperties
参数

plt.xticks(fontproperties=prop,size=14)
plt.yticks(fontproperties=prop,size=14)