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 + i
c = a + i - 0.1
plt.fill_between(a,b,c,facecolor = 'white')
调试把white改成其他颜色比较方便