I had a hard time writing a chart that changes in real time on Jupyter notebook, so I will write the code here.
import matplotlib
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
from random import randint
import time
from ipywidgets import FloatProgress
from IPython.display import display, clear_output
siz = 10
dat = np.zeros((siz, siz))
fig = plt.figure()
axe = fig.add_subplot(111)
num = 1000
for i in range(num):
clear_output(wait = True)
data = np.random.rand(10)
axe.plot(data)
fig.set_size_inches(18.5, 10.5)
display(fig)
# time.sleep(.2)
axe.cla()
Recommended Posts