Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
WxCairo backend.#10395
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
WxCairo backend.#10395
Uh oh!
There was an error while loading.Please reload this page.
Conversation
DietmarSchwertberger commentedFeb 11, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Unfortunately, the situation with Cairo binaries for my main platform Windows is still difficult. |
fwiw anaconda seems to provide pycairo binaries for Windows (https://anaconda.org/anaconda/pycairo). |
Yes, I have seen this, but not tested whether it would be compatible with wx. My interest is in enabling people to embed Matplotlib into wx applications. With wxGlade now also the occasional user should be able to build a wx GUI. Anaconda is something that I would not recommend for this purpose and extracting binaries from Anaconda to 'normal' Python seems also a bit out of scope for most users... |
While testing for bug 10418 I tried all wx backends on my Ubuntu 17.10 VM. The old backends seem to be OK, but with the Cairo I got this one:
According to the documentation of pycairo, |
OK, I've found a minor problem in 'backend_wxagg.py' which breaks The original version was:
The new version is lacking the Toolbar import:
@tacaswell: would you mind commiting the Toolbar import or should I add it to the examples PR? |
surface.get_data was implemented for Py3 in pycairo 1.11.0 (https://pycairo.readthedocs.io/en/latest/changelog.html#v1-11-0) and I would suggest just bumping the min version to it. |
That seems a bit agressive in terms of time (<1 yr) but not that aggressive in terms of versions (they are now in 1.16). I think bumping the minimum on 1.11 and then having packages that can not hit that patch out the new cairo backends. |
Ubuntu 17.10 comes with 1.10 in dist-packages. Even after -mpip I ended up with the old version. Now it's working and I can't reproduce why it failed initially. A small difference with the fourier demo: the waveforms are blue while with WxAgg they are red.... |
@anntzer : I have just checked again on Ubuntu. Indeed the red waveforms are plotted in blue. |
Almost certainly a byteordering issue. I findhttps://wxpython.org/Phoenix/docs/html/wx.Bitmap.html#wx.Bitmap.FromBuffer a bit sparse in the description of the kind of input needed; I can probably manually work it out but do you know the details there (and spare me some manual testing)? |
I think it's actuallyhttps://wxpython.org/Phoenix/docs/html/wx.Bitmap.html#wx.Bitmap.FromBufferRGBA via Anyway it seems that |
anntzer commentedFeb 13, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I thinkhttps://github.com/matplotlib/matplotlib/pull/10429/files is a reasonable way to do this because we're going to need to write it ourselves for tkcairo anyways (which also needs a argb32->rgba8888 conversion). (Ultimately I'll just factor it out in a helper function.) But otherwise something like
seems to work too. |
PR Summary
Same as#10210, but for wx.
attn@DietmarSchwertberger perhaps :-)
not release critical by any means, but would still be nice to have for 2.2.
PR Checklist