在 matplotlib 中绘制重叠线的建议? [英] Suggestions to plot overlapping lines in matplotlib?

查看:117
本文介绍了在 matplotlib 中绘制重叠线的建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人对在情节上显示重叠线的最佳方法有何建议?我有很多这样的想法,我的想法是在不重叠的地方使用不同颜色的实线,在重叠的地方使用虚线,以便可见所有颜色并看到重叠的颜色.

Does anybody have a suggestion on what's the best way to present overlapping lines on a plot? I have a lot of them, and I had the idea of having full lines of different colors where they don't overlap, and having dashed lines where they do overlap so that all colors are visible and overlapping colors are seen.

但是,我该怎么做.

推荐答案

只需减小线条的不透明度,以使它们透明.您可以使用 alpha 变量来实现这一点.示例:

Just decrease the opacity of the lines so that they are see-through. You can achieve that using the alpha variable. Example:

plt.plot(x, y, alpha=0.7)

其中 alpha 范围为 0-1,0 表示不可见.

Where alpha ranging from 0-1, with 0 being invisible.

这篇关于在 matplotlib 中绘制重叠线的建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆