x = np.linspace(-4,4,9)
y = -x
plt.plot(x,y)# 填充绿色大色块
plt.fill_between(x, 0, y, where=abs(x)>=2,facecolor='green', alpha=0.3)#填充白色搞阴影
for i in np.linspace(2,8,40): # 第三个参数调整间距a = x = np.linspace(-8,4,9) # 可以调位置b = a + ic = a + i - 0.1plt.fill_between(a,b,c,facecolor = 'white')
调试把white改成其他颜色比较方便