0

I want to draw a line on y=0. However, I am not sure how to do that using pandas built-in charting. df.mean(axis=1).plot() I am running this and that is the result.

Time series plot

Gal
  • 371
  • 2
  • 14
  • 1
    [`axhline`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.axhline.html). – BigBen Oct 28 '21 at 16:02

1 Answers1

1

Catch the ax instance returned by plot, and you can use axhline:

ax = df.mean(axis=1).plot()
ax.axhline(0, c='r')

Output:

enter image description here

Quang Hoang
  • 146,074
  • 10
  • 56
  • 74