您可以尝试:
plt.fill(np.append(z1, z2[::-1]), np.append(y1, y2[::-1]), 'lightgrey')
例如:
import numpy as npimport matplotlib.pyplot as pltx1 = np.array([1,2,3])y1 = np.array([2,3,4])x2 = np.array([2,3,4,5,6])y2 = np.array([1,2,3,4,5])# plt.plot(x1, y1, 'o')# plt.plot(x2, y2, 'x')plt.scatter(x1, y1, s = 0.5, color = 'blue')plt.scatter(x2, y2, s = 0.5, color = 'orange')plt.fill(np.append(x1, x2[::-1]), np.append(y1, y2[::-1]), 'lightgrey')plt.show()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)