Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. # get image
  2. img = data.astronaut()
  3. print('image size', img.shape)
  4. fig, ax = plt.subplots()
  5. ax.imshow(img)
  6.  
  7. # define patch
  8. patch_loc = (150, 15)
  9. width = 150
  10. height = 170
  11. patch = mpatches.Rectangle(patch_loc, width, height, fill=False, color='blue')
  12.  
  13. # show
  14. ax.add_patch(patch)
  15. plt.tight_layout()
  16. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement