Closed sazl closed 2 years ago
Thanks for reporting. I looked at this and removed the backend switch with a commit. In fact, the change of backend appears unnecessary to me now (I think it was once required to ensure the Navigation bar was there). I am a bit concerned about other side effects, but the on-import global switch is definitely a side-effect to be avoided. Cheers
thank you for the fix, much appreciated 👍🏾 Do you plan on publishing a new version on pip that incorprates this fix?
Thanks
Sure. In fact, I was just working on this (: Cheers
PyAstronomy currently overrides the chosen matplotlib backend setting on import
https://github.com/sczesla/PyAstronomy/blob/f1d34a37a6075580650000fa7d287c524edb01ac/src/pyaGui/pyaPicker.py#L2
This causes problems when an application attempts to set the matplotlib backend after a PyAstronomy import.
Error trace
```python This call to matplotlib.use() has no effect because the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, or matplotlib.backends is imported for the first time. The backend was *originally* set to 'TkAgg' by the following code: File "asad_main.py", line 6, inIt would be helpful if this code was moved to an initialization function so a user can control the switching of the backend.
Thanks