Screen Link:Learn data science with Python and R projects
I am trying to build a graph using matplotlib, and I am having trouble placing descriptive text on the graph itself.
My y values range from .9 to 1.65
, and x ranges from 2001 to 2021
Here are the basics of what I am working with:
fig, ax = plt.subplots(figsize=(10,7))
I know that I have to use ax.text()
to place any text, but whenever I try to enter basically any values for the x and y coordinates of the text, the entire graph disappears when I re-run the cell. I have plotted the following line, but if I use the same coordinates in ax.text()
, I get the output I just described. Why might this be happening?
plt.axhline(y=1.19, xmin=.032, xmax=.96)