I'm adding a text field to a plot. To determine the size of the letters I use fontsize parameter:
import matplotlib.pyplot as plt
r = plt.Rectangle((2,2), 10, 10, fill = False)
plt.gca().add_patch(r)
plt.text(7, 7, 'my rectangle', fontsize = 12, ha='center', va='center')
plt.axis(xmin = 0, xmax = 14, ymin = 0, ymax = 14)
I want the text 'my rectangle' to be exactly 2 units (of the y-axis) high. Is there any way to do this?
