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.
Asked
Active
Viewed 2,175 times
0

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 Answers
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:

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