Advertisement
Guest User

Untitled

a guest
Apr 28th, 2022
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. from turtle import color
  3. import matplotlib.patches as mpatches
  4.  
  5. plt.xlabel("x",fontweight ='bold', size=10)
  6. plt.ylabel("y", fontweight ='bold',size=10)
  7.  
  8. minimum = 10000
  9. maximum = -10000
  10.  
  11. colors = ['red','blue','green','yellow','black','purple','aqua','sienna','brown','cyan','firebrick','coral','gray','deepskyblue','forestgreen']
  12.  
  13. for _ in range(int(input())):
  14. x1,y1,x2,y2 = map(int,input().split())
  15. minimum = min(minimum,x1,y1)
  16. maximum = max(maximum,x2,y2)
  17. left = x1
  18. bottom = y1
  19. width = x2-x1
  20. height = y2-y1
  21. print(left,bottom,width,height)
  22. plt.gca().add_patch(mpatches.Rectangle((left,bottom),width,height,color=colors[_%15],linewidth=2))
  23.  
  24.  
  25. plt.xlim([2*minimum,2*maximum])
  26. plt.ylim([2*minimum,2*maximum])
  27. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement