xValues1 = np.linspace(-5, 5, 5000)
xValues2 = np.linspace(-5, 5, 5000)
yValues1 = -xValues1**2 + 10
yValues2 = -xValues2**2 + 18
plt.ylim(0,20)
plt.plot(xValues1, yValues1, color='green', linewidth=5, alpha=0.5)
plt.plot(xValues2, yValues2, color='cyan', linewidth=5, alpha=0.5)
plt.fill_between(xValues1, yValues1, color='green', alpha=0.5)
plt.fill_between(xValues2, yValues2, color='cyan', alpha=0.5)
产生this plot where the colors of the line and fill are different.
我该如何补救?
答案 0 :(得分:0)
这是由于行号。尝试使用两个plt.plot
函数:
linewidth=0