Matplotlib transparent line plots

前端 未结 3 613
春和景丽
春和景丽 2020-12-02 11:07

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

3条回答
  •  天命终不由人
    2020-12-02 11:20

    After I plotted all the lines, I was able to set the transparency of all of them as follows:

    for l in fig_field.gca().lines:
        l.set_alpha(.7)
    

    EDIT: please see Joe's answer in the comments.

提交回复
热议问题