Skip to content

Instantly share code, notes, and snippets.

@zhicongchen
Last active April 21, 2022 03:04
Show Gist options
  • Save zhicongchen/88749f80f0857f47f1f7b453c4142764 to your computer and use it in GitHub Desktop.
Save zhicongchen/88749f80f0857f47f1f7b453c4142764 to your computer and use it in GitHub Desktop.
from matplotlib import font_manager
fontprop = font_manager.FontProperties(fname='path\to\font\msyh.ttf')
plt.legend(prop=fontprop)
plt.xlabel('XXX',fontproperties=fontprop)
plt.ylabel('XXX',fontproperties=fontprop)
plt.title('XXX',fontproperties=fontprop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment