首先
import matplotlib.pyplot as plt import numpy as np # 定义 x 轴和 y 轴的数据 x = np.arange(4,19) y_max = np.array([31,33,34,34,33,31,30,29,30,29,26,23,21,25,31]) y_min = np.array([12,19,20,20,22,22,21,22,16,18,18,17,14,15,16]) # 绘制折线图 plt.plot(y_max) plt.plot(y_min) # 显示图形 plt.show()
import matplotlib.pyplot as plt
import numpy as np
# 定义 x 轴和 y 轴的数据
x = np.arange(5,20)
y_max = np.array([31,33,34,34,33,31,30,29,30,29,26,23,21,25,31])
y_min = np.array([12,19,20,20,22,22,21,22,16,18,18,17,14,15,16])
# 绘制折线图
plt.plot(y_max)
plt.plot(y_min)
# 显示图形
plt.show()