How to plot the lines first and points last in matplotlib

前端 未结 1 991
粉色の甜心
粉色の甜心 2020-12-08 09:28

I have a simple plot with several sets of points and lines connecting each set. I want the points to be plotted on top of the lines (so that the line doesn\'t show inside t

相关标签:
1条回答
  • 2020-12-08 09:56

    You need to set the Z-order.

    plt.plot(R,P,color='0.2',lw=1.5, zorder=1)
    plt.scatter(R,P,s=150,color=c, zorder=2)
    

    Check out this example. http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html

    0 讨论(0)
提交回复
热议问题