I am using Python 3.9 in Spyder and have a problem with plotting. Whenever I plot something, in the "Plot" Pane, a new plot pops up.
For my application, I want to update the plot very quickly but every time I plot the figure, a new figure appears in the "Plot" Pane and after 500 plots it gets very laggy. With hours of searching on the web, I have found no good way to do it.
Ideally, the plot contents should just be removed and not the figure or axes.
My code is as follows:
import matplotlib.pyplot as plt # Module for plotting data
import time # Module for acquiring times
for i in range(1,11):
fig = plt.figure()
ax = plt.axes(projection = '3d')
ax.set_xlim(-10,10)
ax.set_ylim(-10,10)
ax.set_zlim(-10,10)
ax.quiver(0,0,0,i,i,i)
plt.show()
time.sleep(0.1)
Its very straight forwards and easy, but all it produces is 10 individual plots in the "Plot" pane (I muted Inline Plotting). Preferably, I would have one plot which just updates, either in the "Plot" Pane of Spyder or as a seperate window.