import numpy as np
x = [0, 1, 2, 4, 6, 9, 10, 15]
y1 = [0, 1, 4, 16, 25, 16, 45, 18]
y2 = [6, 5, 4, 2, 3, 1, 4, 3]
y1 = [y1[i] for i in range(len(x)) if 2 <= x[i] <= 9]
y2 = [y2[i] for i in range(len(x)) if 2 <= x[i] <= 9]
x = [i for i in x if 2 <= i < 9]
print("y1 max:", np.amax(y1))
print("y2 max:", np.amax(y2))
1条答案
按热度按时间fdx2calv1#
如果这是您的意思,您可以在同一个图中绘制多条线,如下所示:
此外,要获得最高点: