I am new to macplotlib and can only do the simplest things but there are many hidden complexities I can’t figure out that are now killing me. My big problem is everytime I plot I get a new ‘figure’ which I first thought was just a mysterious incrementing number but in fact seems to be some kind of persistent object which consumes resources and won’t go away. I don’t even know what a figure is. Where does it exist? Where is it’s state recorded? How do I get rid of them? Now I have so ‘figures’ many that performance is degraded and matplotlib is becoming unusable. I have many times closed them all by patiently clicking the close box of all 286 (now empty) windows but that apparently only hides them because they all pop up again when I make a new plot. I tried killing python but they all reappear the next time I run a python script. The top of my plot script now has the following code but it apparently doesn’t do anything:
for i in range(285):
I rebooted but the mess all comes back.
From many google searches I’ve recently discovered this is all apparently part of something normally hidden called a backend which is another thing I never heard of before this problem got out of control. I started using matplotlib from various online pyplot tutorials. The words ‘close’, ‘backend’ and ‘figure’ were never mentioned in any of them, so I had no warning.
Is this the right forum for this problem?
is there an easy way to get rid of figures. Can I reset or uninstall/reinstall something that will allow me to start over so I can use matplotlib again?
Where is this hidden infrastrastructure documented? What is its name? What keywords do I need to google to figure this out.
How do I do simple plots which go away when I am done looking at them? I have no current need for persistent plots.
Why is this so hard? I just want to plot some data.
Python 3.7.6 installed by homebrew
OS: Catalina 10.15.3