Matplotlib vline label parameter not showing

后端 未结 3 1846
再見小時候
再見小時候 2021-02-20 03:32

I want to label my vertical lines with matplotlib\'s .vline command, but for some reason the label parameter doesn\'t do anything/show anything on the final plot. Does anyone kn

3条回答
  •  梦如初夏
    2021-02-20 04:09

    This works

    plt.plot(x,y)
    plt.vlines(x=pah, ymin=0, ymax=0.6, colors='0.75', linestyles='dashed', label='PAHs')
    plt.legend()
    

    but I don't know if this is what you expect

提交回复
热议问题