How to draw a rectangle on image
You can add a Rectangle patch to the matplotlib Axes. For example (using the image from the tutorial here): import matplotlib.pyplot as plt import matplotlib.patches as patches from PIL import Image im = Image.open(‘stinkbug.png’) # Create figure and axes fig, ax = plt.subplots() # Display the image ax.imshow(im) # Create a Rectangle patch rect = … Read more