How to add a text into a Rectangle?
I think you need to use the annotate method of your axes object. You can use properties of the rectangle to be smart about it. Here’s a toy example: import matplotlib.pyplot as plt import matplotlib.patches as mpatch fig, ax = plt.subplots() rectangles = {‘skinny’ : mpatch.Rectangle((2,2), 8, 2), ‘square’ : mpatch.Rectangle((4,6), 6, 6)} for r … Read more