散点图
from matplotlib import pyplot as plt
from matplotlib import font_manager # 字体相关# 字体
font_path = r"C:\Windows\Fonts\msyh.ttc"
my_font = font_manager.FontProperties(fname=font_path)x = list(range(31))
x2 = list(range(31, 62))
a3 = [11, 17, 16, 11, 12, 11, 12, 6, 6, 7, 8, 9, 12, 15, 14, 17,18, 21, 16, 17, 20, 14, 15, 15, 15, 19, 21, 22, 22, 22, 23]
b10 = [26, 26, 28, 19, 21, 17, 16, 19, 18, 20, 20, 19, 22, 23,17, 20, 21, 20, 22, 15, 11, 15, 5, 13, 17, 10, 11, 13, 12, 13, 6]# 绘图
_xtick_labels = ["3月{}号".format(i) for i in range(31)]
_xtick_labels += ["10月{}号".format(i) for i in range(31, 62)]plt.xticks((x+x2)[::3], _xtick_labels[::3], rotation=45, fontproperties=my_font)plt.scatter(x, a3)
plt.scatter(x2, b10)# 展示
plt.show()
散点图
from matplotlib import pyplot as plt
from matplotlib import font_manager # 字体相关# 字体font_path = r"C:\Windows\Fonts\msyh.ttc"
my_font = font_manager.FontProperties(fname=font_path)# 参数
y_3 = [11, 17, 16, 11, 12, 11, 12, 6,