使用fill_between更改线条颜色

时间:2020-09-15 10:52:17

标签: python matplotlib

我在matplotlib中有一个图,如下所示:

enter image description here

我有两个值分别为x和y的数组。当x大于y时,它将填充白色,如果不是,则颜色应为蓝色。但是,我希望线条与正在绘制的数组的颜色相同。像这样:

enter image description here

为此,我尝试了这段代码:

f3_ax7.fill_between(all_mins, x, y, where=(x > y), color = 'white', alpha=0.4, interpolate=True, linewidth=10, edgecolor='white')

f3_ax7.fill_between(all_mins, y, x, where=(x > y), color = 'blue', alpha=0.4, interpolate=True, linewidth=10, edgecolor='blue')

但是颜色总是蓝色。

有什么想法吗?

亲切的问候

0 个答案:

没有答案