Placing vertical line behind other plots in Matplotlib

Viewed 556

I am trying add a vertical line using Matplotlib but I want it to be behind my other plot lines. Currently it overlaps my other lines. Is there a simple way to do this?

plt.axvline(x=date, linestyle=':', color='lightgray')
1 Answers

you should use the parameter zorder

plt.axvline(x=date, linestyle=':', color='lightgray', zorder=0)

your other lines need an higher zorder values

Related