Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import matplotlib.patches as patches
- import numpy as np
- import pylab
- from random import randint
- def arsplot(rho,phi,wid,height):
- for i in range(len(rho)):
- phi[i]=phi[i]+randint(0,9)
- rho[i]=rho[i]+randint(-5,5)
- ax1.add_patch(patches.Rectangle((rho[i],phi[i]),wid[i],height[i]))
- rho=[12, 16, 18, 4, 11, 6, 17]
- phi=[12,16,18,4,11,6,17]
- wid=[2,2,2,2,2,2,2]
- height=[1,1,1,1,1,1,1]
- fig1=plt.figure(figsize=(15,32))
- ax1=fig1.add_subplot(111, aspect='equal')
- plt.grid(True)
- pylab.xlim([-25,45])
- pylab.ylim([-15,55])
- while True:
- arsplot(rho,phi,wid,height) #function call
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement