mirror of
https://gitlab.com/triple-hops-brewed/raspberry-pi-stock-ticker.git
synced 2025-06-15 14:56:38 +00:00
46 lines
706 B
Python
46 lines
706 B
Python
#%%
|
|
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()
|
|
|
|
|
|
#%%
|