查找中文字体

find /usr/share/fonts/ -name "*.ttc"

Ubuntu Matplotlib 显示中文

设置Matplotlib字体

from matplotlib.font_manager import FontProperties

font = FontProperties(fname=r"/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc") # 从上面随便选一个
plt.title("标题", fontproperties=font)
plt.xlabel("x轴标签", fontproperties=font)
plt.ylabel("y轴标签", fontproperties=font)
plt.show()

Ubuntu Matplotlib 显示中文

相关文章:

  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2021-08-02
  • 2021-11-10
  • 2021-12-06
猜你喜欢
  • 2022-02-10
  • 2021-07-26
  • 2022-12-23
  • 2021-09-19
  • 2021-04-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案