Home > Software design >  How to plot vertical lines at specific dates in matplotlib
How to plot vertical lines at specific dates in matplotlib

Time:03-10

How could I add a vertical line marker to this chart at a specific date? Week end is the date column.

fig, ax = plt.subplots(figsize=(20,9))
thirteen.plot.line(x='Week end', y='OFF', color='crimson', ax=ax)
thirteen.plot.line(x='Week end', y='ON', color='blue', ax=ax)
ax.set_ylim(bottom=0)
plt.show()

image of output

CodePudding user response:

First make sure the date column Week end has been converted output

  • Related