I have ~20 plots with different axes, ranging from scales of 0-1 to 0-300. I want to use plt.text(x,y)
to add text to the top left corner in my automated plotting function, but the changing axis size does not allow for this to be automated and completely consistent.
Here are two example plots:
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show()
#Plot 2
plt.plot([2, 4, 6, 8])
plt.ylabel('some numbers')
plt.show()
I want to use something like plt.text(x, y, 'text', fontsize=8)
in both plots, but without specifying the x
and y
for each plot by hand, instead just saying that the text should go in the top left. Is this possible?