Skip to content
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

Does the gtk3agg backend work on python3? #1227

Merged
merged 1 commit into from Jan 22, 2014

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Jan 17, 2014

Whatsnew indicates that the gtk3agg backend works on python3. However
backend_gtk3agg.py still contains a warning about in not working:

warnings.warn("The Gtk3Agg backend is not known to work on Python 3.x.")

and I'm still seeing the error given in the original pull request (#590) when using this backend on python3
on ubuntu 12.04.

NotImplementedError: Surface.create_for_data: Not Implemented yet.

Does it work with more resent versions of the gtk3 bindings for python3?

Edit: Ubuntu 12.04 ships with python3-gi 3.2.2

@mdboom
Copy link
Member

mdboom commented Sep 10, 2012

Sorry -- this is an error on my part in the release notes. I'll fix that.

It doesn't work yet, given the lack of "Surface.create_for_data" in pycairo. It's not clear to me when that will be implemented in a released version and why it hasn't been. See my e-mail question here:

http://lists.cairographics.org/archives/cairo/2011-November/022519.html

@mdboom
Copy link
Member

mdboom commented Sep 10, 2012

I have updated the docs, but I am leaving this open with "upstream fix required" so we can track the progress of Cairo.

@spinnau
Copy link
Contributor

spinnau commented Dec 11, 2012

@mdboom A new implementation of the ImageSurface.create_for_data() method was committed in the pycairo git repo a few month ago (after your test of the git version as described in the mailing list). But until now there is now new release available...

@mdboom
Copy link
Member

mdboom commented Dec 11, 2012

Yes, I believe for the time being you need to build pycairo from the git repository from source.

@eduardohenriquearnold
Copy link

Unfortunately they didn't build another version and don't seem worried about this either. Isn't there another option besides pycairo to make matplotlib available in GTK3 with Python3?

It's disappointing to have matplotlib, numpy and pygobject working with Python3 but not being able to integrate all this amazing tools.

@mdboom
Copy link
Member

mdboom commented May 17, 2013

Yes -- it is annoying. Unfortunately, I don't think there's a technical workaround from our end -- all we can do it put more pressure on the pycairo folks to make a new release.

@mattip
Copy link
Contributor

mattip commented May 29, 2013

What would be the easiest way to see if cairocffi (which seems to have ImageSurface.create_for_data() ) could work with matplotlib?

@tacaswell
Copy link
Member

@fariza Do you know if gtk + py3k works now?

@fariza
Copy link
Member

fariza commented Jan 17, 2014

@tacaswell I don't know

@mdboom
Copy link
Member

mdboom commented Jan 17, 2014

pycairo still hasn't had a release since 2011.

However, as @mattip suggested (8 months ago, now, sorry), cairocffi does appear to work, with some minor tweaks. Attached is code to support cairocffi, if installed, which also provides away for Gtk3Agg to work on Python 3.

@tacaswell
Copy link
Member

failures are more smoketest time outs.

tacaswell added a commit that referenced this pull request Jan 22, 2014
Does the gtk3agg backend work on python3?
@tacaswell tacaswell merged commit 157eec9 into matplotlib:master Jan 22, 2014
jenshnielsen added a commit to jenshnielsen/matplotlib that referenced this pull request Jul 14, 2014
This has been fixed by using cairocffi according to matplotlib#1227
joferkington pushed a commit to joferkington/matplotlib that referenced this pull request Jul 23, 2014
This has been fixed by using cairocffi according to matplotlib#1227
@mdboom mdboom deleted the cairocffi branch August 7, 2014 13:53
jbmohler pushed a commit to jbmohler/matplotlib that referenced this pull request Aug 14, 2014
This has been fixed by using cairocffi according to matplotlib#1227
@SchrodengerY
Copy link

I also meet this problem.
And I solve it by using
import matplotlib matplotlib.use('Qt5Agg')
But I don't know why.

@tacaswell
Copy link
Member

@SchrodengerY If you use use("Qt5Agg") than you are using the Qt5 gui toolkit, not the gtk3 gui toolkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants