-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
matplotlib 1.5 compatibility with wxPython #5737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry for not responding on this earlier. It seems to work if I explicitly set the WX/WXAgg backend before importing pylab import wx
import matplotlib
matplotlib.use('WXAgg')
import pylab
app = wx.App(False)
app.frame = wx.Frame(None)
app.frame.Centre()
app.frame.Show() |
It's likely that this is related to the work in #3421 that enabled support for WXPython phoenix |
If you do from __future__ import print_function
import matplotlib.pyplot as plt
import matplotlib
print(matplotlib.get_backend()) what do you get? My suspicion here is that you are importing wx, it may or may not be installing the input hook, and then |
I get 'Qt4Agg' as the default backend. If I set the backend as 'WXAgg' before importing pylab as jenshnielsen suggested, the error happens as before. |
Can you try 1.5.1rc1? I can reproduce the hanging with 1.5.0 but not with 1.5.1rc1 |
My original code still fails with 1.5.1. However, if I add |
In your original example you will import both WX and Qt4 since matplotlib defaults to the Qt4Agg backend and you import WX. Importing more than one GUI framework is unsupported and will in general lead to wrong behaviour. If you want to use matplotlib within a WX app you should make sure that it runs with the WX backend. |
I think this can close, it looks like this is only triggered when more than one gui backend is involved is an unsupported way |
I'm running into a strange compatibility problem between wxPython and matplotlib.
With matplotlib 1.5.0 or higher, this code will not run -- it hangs with no error on:
If I comment out "import pylab", it works fine. "import matplotlib" does not cause an error, but "import matplotlib.pyplot as plt" does.
With matplotlib 1.4.2, this code works fine as is, including the pylab import. This is with wxPython 3.0.2.0 and on OSX El Capitan.
I've looked for possible changes here: http://matplotlib.org/1.5.0/api/api_changes.html, but nothing appears relevant.
Any ideas about what's gone wrong?
The text was updated successfully, but these errors were encountered: