You will have to animate a graph.
IPython.display
to produce and clear output.We will need to import:
from IPython.display import display, clear_output
import matplotlib.pylab as plt
from IPython.display import display, clear_output
import matplotlib.pylab as plt
import numpy as np
fig, ax = plt.subplots(figsize=(5,5))
x = np.arange(10)
y = x**2
plt.plot(x,y,'*')
[<matplotlib.lines.Line2D at 0x7f9f10f776d0>]
from IPython.display import display, clear_output
import matplotlib.pylab as plt
import numpy as np
fig, ax = plt.subplots(figsize=(5,5))
#### SUPER BUGS ####
x_list=[]
y_list=[]
for x in np.arange(9):
x_list.append(x)
y_list.append(x**2)
plt.plot(x_list, y_list, '*')
plt.axis([0, 9, 0, 81])
#### SUPER BUGS ####
## Stay the same
clear_output(wait=True) # clears display
display(fig) # resets display
fig.clear() # stops overlapping
<Figure size 360x360 with 0 Axes>