This commit is contained in:
2024-01-02 13:25:52 +01:00
parent 50082333b7
commit 00e350c6a2
145 changed files with 13825 additions and 360 deletions

View File

@@ -5,6 +5,8 @@ from matplotlib.animation import FuncAnimation
import ast
import seaborn as sns
sns.set_theme()
params = {
"font.family": "Serif",
"font.serif": "Roman",
@@ -23,7 +25,7 @@ ax = plt.gca()
img = ax.imshow([[]])
def plot():
with open("test.txt") as f:
with open("data/animation.txt") as f:
lines = f.readlines();
size = int(lines[0])
for line in lines[1:]:
@@ -49,8 +51,9 @@ if __name__ == "__main__":
plot()
norm = matplotlib.cm.colors.Normalize(vmin=0, vmax=np.max(wave_arr[0]))
img = ax.imshow(wave_arr[0], extent=[0,1,0,1], cmap=plt.get_cmap("viridis"), norm=norm)
plt.grid(False)
img = ax.imshow(wave_arr[0], extent=[0,1,0,1], cmap=sns.color_palette("mako", as_cmap=True), norm=norm)
anim = FuncAnimation(fig, animation, interval=1, frames=np.arange(0,len(wave_arr)), repeat=True, blit=0)
# plt.show()
anim.save("./animation.mp4", writer="ffmpeg", bitrate=10000, fps=15)
anim.save("./animation.gif", writer="ffmpeg", bitrate=10000, fps=15)