Closed laurenmarietta closed 5 years ago
This looks similar to issue #103.
I have found that in many cases matplotlib
crashes when using the default backend (at least on Mac OS X and certain Linux distributions). Given the propensity for these crashes, it may be preferable to use a different graphics backend such as TkAgg. This can either be accomplished by setting matplotlib.use("TkAgg")
after importing matplotlib
or setting the default backend via your matplotlibrc file (https://matplotlib.org/users/customizing.html#the-matplotlibrc-file). I personally employ the latter option.
The GUI is problematic because of different backends on different platforms, yes. I concur with the recommendation to try different backends and see if that works more reliably for your setup. That said, the GUI is not being actively developed any more, and there are many options that are available in the Python API but not the GUI. So just be aware that it's fine to use the GUI but you will have more capabilities if you work directly with the programming interface.
Great - declaring matplotlib.use('TkAgg')
before importing webbpsf did the trick.
It might be useful to add a clause to the GUI script that determines what matplotlib backend is actively being used, and asks the user to change to TkAgg if it detects a different backend (rather than running and crashing)? Though I hear that the GUI isn't being developed anymore, so maybe it's not worth the trouble.
Just a thought - Marshall, if active development of the GUI is something you think would be worthwhile to start up again, that's something I might be interested in taking up!
Looking back at this old issue. I'd rather not put any substantial efforts into the GUI for WebbPSF at this point. But we should at least better document this all on the installation instructions, to alert people to the possible need to work around matplotlib backend issues.
Using the latest version of webbpsf (https://github.com/mperrin/webbpsf/commit/66ed310c33051a8e29a7ea9333aff75c2a00c38c) in Python 3.5, calling
webbpsf.gui()
results in this gnarly error:I suspect this might have something to do with a backend... maybe?