SimHei字体下载
https://pan.baidu.com/s/14BzhntzSeEjE4FmlVENwUw?pwd=1111
用我自己的,看了好几个其他博主的帖子,所用的下载链接都失效了,太TM不靠谱了
import matplotlib.pyplot as plt
import random
x = range(60)
x_ticks_label = ["11点{}分".format(i) for i in x]
y_ticks=range(40)
y_shanghai=[random.uniform(15,18) for i in x]
plt.figure(figsize=(20,8),dpi=100)
plt.plot(x,y_shanghai)
plt.xticks(x[::5],x_ticks_label[::5])
plt.yticks(y_ticks[::5])
plt.show()