def __init__(self, x, y_max, y_min):
self.x = x
self.y_max = max
self.y_min = min
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 21)
y_max = np.array([24, 27, 32, 24, 35, 30, 28, 26, 24, 28, 30, 32, 26, 33, 35, 30, 28, 26, 24, 28])
y_min = np.array([25, 21, 20, 22, 21, 23, 20, 21, 27, 18, 19, 25, 20, 22, 21, 23, 20, 21, 23, 18])
# 绘图
plt.plot(x, y_max, color='red')
plt.plot(x, y_min, color='g')
plt.show()
可视化折线图
于 2023-09-22 00:42:26 首次发布