如何使用Matplotlib显示折线图的阴影?

时间:2020-07-28 15:48:14

标签: python matplotlib

我正在尝试为我拥有的某些数据创建阴影。 View the current image here

我无法增加投影的宽度。有办法吗?

这是我目前拥有的:

plt.plot(times, past_values,color='red',path_effects=[path_effects.SimpleLineShadow(shadow_color="red"),path_effects.Normal()])

2 个答案:

答案 0 :(得分:0)

您可以简单地添加shadow=True 这是一个例子

plt.plot(times, past_values,color='red',shadow=True)

尝试一下可能会起作用

答案 1 :(得分:0)

您需要将linewidth参数传递给SimpleLineShadow

plt.plot(times, past_values,color='red',path_effects=[path_effects.SimpleLineShadow(shadow_color="red", linewidth=5),path_effects.Normal()])