Last active
November 19, 2019 16:54
-
-
Save jhjensen2/13fa53b849965c93efebed2849f9bf69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from IPython.display import clear_output | |
import time | |
n_particles = 100 | |
for x in range(50): | |
clear_output(wait=True) | |
positions_x = [np.random.random() for i in range(n_particles)] | |
positions_y = [2*(np.random.random()-0.5) for i in range(n_particles)] | |
plt.plot(positions_x , positions_y,'ro') | |
plt.axis((-1.0 , 1.0 , -1.0 , 1.0)) | |
plt.show() | |
time.sleep(0.01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment