Matplotlib透明线图 [英] Matplotlib transparent line plots
本文介绍了Matplotlib透明线图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在matplotlib中绘制两条相似的轨迹,并且我希望以部分透明的方式绘制每条线,以使红色(绘制第二位)不会遮盖蓝色.
I am plotting two similar trajectories in matplotlib and I'd like to plot each of the lines with partial transparency so that the red (plotted second) doesn't obscure the blue.
编辑:这是带有透明线条的图像.
EDIT: Here's the image with transparent lines.
推荐答案
简单而又简单:
plt.plot(x, y, 'r-', alpha=0.7)
(我知道我没有添加任何新内容,但是直接的答案应该可见).
(I know I add nothing new, but the straightforward answer should be visible).
这篇关于Matplotlib透明线图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文