Guest User

Plot loop iteration

a guest
Feb 8th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import matplotlib.pyplot as plt
  2. from random import uniform
  3.  
  4. plt.ion()
  5.  
  6. def plot_chart(iteration_number, freq_state):
  7.     plt.scatter(iteration_number, freq_state)
  8.     plt.show()
  9.     plt.pause(0.0001)
  10.  
  11. for i in range(1,1001):
  12.     state = uniform(0,1)
  13.     plot_chart(i, state )
  14.     plt.pause(0.0001)
Add Comment
Please, Sign In to add comment