Created
March 27, 2024 20:21
-
-
Save DanyelMorales/7a560b358586beb086d26fae1c428043 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 display, clear_output | |
fig = plt.figure() | |
ax = fig.add_subplot(1, 1, 1) | |
for i in range(20): | |
x = np.arange(0, i, 0.1); | |
y = np.sin(x) | |
ax.set_xlim(0, i) | |
ax.cla() | |
ax.plot(x, y) | |
display(fig) | |
clear_output(wait = True) | |
plt.pause(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will create an animation-like graph to visualize changes overtime