# -*- coding: UTF-8 -*-
import numpy as np

import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties

x = np.linspace(0,2*np.pi,50)
plt.plot(x,np.sin(x),'r-x',label='Sin(x)')
plt.plot(x,np.cos(x),'g-',label='Cos(x)')
plt.legend()
#主要是下面 font
= FontProperties(fname='/System/Library/Fonts/PingFang.ttc') plt.xlabel(u'', fontsize=18, fontproperties=font) plt.ylabel(u'', fontsize=18, fontproperties=font) plt.title(u'秦时明月', fontsize=18, fontproperties=font) plt.show()

 

相关文章:

  • 2021-11-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-07-07
  • 2021-05-23
  • 2021-10-25
猜你喜欢
  • 2021-11-10
  • 2021-04-28
  • 2022-12-23
  • 2021-12-06
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案