How do you plot a vertical line on a time series plot in Pandas?

plt.axvline(x_position)

It takes the standard plot formatting options (linestlye, color, ect)

(doc)

If you have a reference to your axes object:

ax.axvline(x, color="k", linestyle="--")

Leave a Comment