Is there a way I can make the matplotlib shape disappear and reappear in response to some kind of event? (i.e. keystroke)
I tried using fig.set_visible(False), but for me it does nothing.
A simple code example:
import matplotlib
import matplotlib.pyplot as plt
fig=matplotlib.pyplot.figure(figsize=(10, 10))
def toggle_plot():
fig.set_visible(not fig.get_visible())
plt.show()
The reason I'm trying to do this is because I have a bunch of plots / animations on the diagram that show the result of the simulation, but displaying them all the time slows down my computer. Any ideas?
Brent source
share