Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- from turtle import color
- import matplotlib.patches as mpatches
- plt.xlabel("x",fontweight ='bold', size=10)
- plt.ylabel("y", fontweight ='bold',size=10)
- minimum = 10000
- maximum = -10000
- colors = ['red','blue','green','yellow','black','purple','aqua','sienna','brown','cyan','firebrick','coral','gray','deepskyblue','forestgreen']
- for _ in range(int(input())):
- x1,y1,x2,y2 = map(int,input().split())
- minimum = min(minimum,x1,y1)
- maximum = max(maximum,x2,y2)
- left = x1
- bottom = y1
- width = x2-x1
- height = y2-y1
- print(left,bottom,width,height)
- plt.gca().add_patch(mpatches.Rectangle((left,bottom),width,height,color=colors[_%15],linewidth=2))
- plt.xlim([2*minimum,2*maximum])
- plt.ylim([2*minimum,2*maximum])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement