Updating bar and plot subplots over loop iterations
问题 I wrote the following snippet and I am trying to make it update the plots. What I get instead is an overlapping of new plots on the old ones. I researched a bit and found I needed relim() and autoscale_view(True,True,True) on the current axis. I still cannot get the desired behaviour. Is there a way to force pyplot to delete/remove the old drawing before calling plt.draw()? import numpy as np import matplotlib.pyplot as plt import time plt.ion() a = np.arange(10) fig,ax = plt.subplots(2,1)