plonfat
plonfat

Reputation: 499

Ploting ax.axhline using timestamp for min and max range

I am trying to plot horizontal lines for a specific period of time.

The index of my df is DatetimeIndex.

# This plot a horizontal line:
ax.axhline(df.threshold[0], 0, 0.25).   #but the range (min, max) is not precise)

# This doesn't plot any line nor give any error message
ax.axhline(df.threshold[0], df.index[0], df.index[50])

Many thanks in advance for your help !

Upvotes: 0

Views: 406

Answers (1)

plonfat
plonfat

Reputation: 499

Simply use:

ax.hlines instead of ax.axhline.

Upvotes: 0

Related Questions