Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # get image
- img = data.astronaut()
- print('image size', img.shape)
- fig, ax = plt.subplots()
- ax.imshow(img)
- # define patch
- patch_loc = (150, 15)
- width = 150
- height = 170
- patch = mpatches.Rectangle(patch_loc, width, height, fill=False, color='blue')
- # show
- ax.add_patch(patch)
- plt.tight_layout()
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement