I can't get my text to show in my plot, axhline() shows, but not text(). I'm new to pandas and matplotlib and I'm obviously not understanding something.
# df is a pandas Dataframe
df_last_24 = df[df['Date']>=(dt.datetime.now()-dt.timedelta(hours=24))]
ax = df_last_24.plot.line(x="Date",title="Air Qualty Index over the last 24 hours")
# Define the date format
years_fmt = mdates.DateFormatter('%I:%M %p')
ax.xaxis.set_major_formatter(years_fmt)
plot.axhline(linewidth=4,y=300, color='#731425', linestyle='-')
plot.text(0, 300, 'Hazardous', fontsize=10, va='center', ha='left', backgroundcolor='w')
plot.axhline(linewidth=4,y=200, color='#8c1a4b', linestyle='-')
plot.text(0, 200, 'Very Unhealthy', fontsize=10, va='center', ha='left', backgroundcolor='w')
plot.axhline(linewidth=4,y=150, color='#951d47', linestyle='-')
plot.text(0, 150, 'Unhealthy', fontsize=10, va='center', ha='left', backgroundcolor='w')
plot.axhline(linewidth=4,y=100, color='#e23127', linestyle='-')
plot.text(0, 100, 'Unhealthy to Sensitive Groups', fontsize=10, va='center', ha='left', backgroundcolor='w')
plot.axhline(linewidth=4,y=50, color='#f29d3a', linestyle='-')
plot.text(0, 50, 'Moderate', fontsize=10, va='center', ha='left', backgroundcolor='w')
plot.show(block=True)

