首先导入模块
from matplotlib import font_manager as fm
from matplotlib import pyplot as plt
import random
#导入字体操作
from matplotlib import font_manager as fm
my_font = fm.FontProperties(fname = "C:\Windows\Fonts\simhei.ttf")
fig = plt.figure(figsize=(20,8),dpi = 80)
x = range(0,120)
y = [random.randint(20,35) for i in range(120)]
plt.plot(x,y)
#要显示出来
_x_ticks = ["10点{}分".format(i) for i in range(0,60)]
#接下去的列表
_x_ticks += ["11点{}分".format(i-60) for i in range(60,120)]
#对x轴进行操作调整
plt.xticks(x[::5],_x_ticks[::5],rotation = 45,fontproperties = my_font)
plt.show()