散点图示例
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
from matplotlib import font_manager
myfont01 = font_manager.FontProperties(fname="C:\Windows\Fonts\simsun.ttc")
y_3 = [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]
y_10 = [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]
x_3 = [x for x in range(1, 32)]
x_10 = [x for x in range(32, 63)]
plt.figure(figsize=(20, 8), dpi=80)
plt.scatter(x_3, y_3)
plt.scatter(x_10, y_10)
_x = x_3 + x_10
_xticks_labels = ["3月{0}日".format(x) for x in range(1, 32)]
_xticks_labels += ["10月{0}日".format(x-31) for x in range(32, 63)]
plt.xticks(_x[::3], _xticks_labels[::3], fontproperties=myfont01, rotation=45)
plt.xlabel("日期", fontproperties=myfont01)
plt.ylabel("温度", fontpro