diff --git a/sim.py b/sim.py new file mode 100644 index 0000000..4b98e9b --- /dev/null +++ b/sim.py @@ -0,0 +1,45 @@ +#%% +import matplotlib.pyplot as plt +from matplotlib.animation import FuncAnimation +import numpy as np + +#%% +matrixSize = (32, 64, 3) +#%% +a = np.random.randint(1, high=256, size=(32, 128, 3)) + +# for i in range(10): +# a = np.delete(a,0,1) +# a.shape + +#%% +plt.imshow(a[:, :64]) +plt.show() + +#%% +blank = np.zeros(matrixSize, dtype=int) +noise = np.random.randint(1, high=256, size=(32, 128, 3)) + +#%% +buffer = np.concatenate((blank, noise), axis=1) + + +#%% +plt.imshow(buffer[:, :64]) +plt.show() + + +#%% +fig = plt.figure(figsize=matrixSize[0:2], facecolor="black") + + +def update(): + np.delete(buffer, 0, 1) + + +plt.imshow(buffer[:, :64]) +ani = FuncAnimation(fig, update, frames=buffer.shape[1]) +plt.show() + + +#%%