Advertisement
Guest User

Untitled

a guest
Aug 28th, 2015
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. import matplotlib.patches as patches
  3. import numpy as np
  4. import pylab
  5. from random import randint
  6.  
  7. def arsplot(rho,phi,wid,height):
  8.  
  9. for i in range(len(rho)):
  10.  
  11. phi[i]=phi[i]+randint(0,9)
  12. rho[i]=rho[i]+randint(-5,5)
  13. ax1.add_patch(patches.Rectangle((rho[i],phi[i]),wid[i],height[i]))
  14.  
  15.  
  16. rho=[12, 16, 18, 4, 11, 6, 17]
  17. phi=[12,16,18,4,11,6,17]
  18. wid=[2,2,2,2,2,2,2]
  19. height=[1,1,1,1,1,1,1]
  20.  
  21. fig1=plt.figure(figsize=(15,32))
  22. ax1=fig1.add_subplot(111, aspect='equal')
  23. plt.grid(True)
  24. pylab.xlim([-25,45])
  25. pylab.ylim([-15,55])
  26.  
  27. while True:
  28.  
  29. arsplot(rho,phi,wid,height) #function call
  30.  
  31. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement