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
Fix image plotting in Cairo backends #6602
Conversation
Call cairo.ImageSurface.create_for_data with an array that both py2cairo and cairocffi knows how to get a pointer too and size of
More testing. Cairocffi works correctly with GTK3 if py2/3cairo is installed but not otherwise. This is probably just a concequense of the fact that gtk/pygobject is build against py2/3cairo so it can't function without. The gtk2 backend however breaks if Cairocffi is installed |
The issue with cairocffi and GKT2 is not new and can be reproduced on 1.5.x Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 438, in expose_event
self._render_figure(self._pixmap, w, h)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 426, in _render_figure
self.figure.draw (self._renderer)
File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 62, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1159, in draw
func(*args)
File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 62, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 2319, in draw
a.draw(renderer)
File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 62, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/image.py", line 394, in draw
renderer.draw_image(gc, l, b, im)
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_cairo.py", line 181, in draw_image
ctx.set_source_surface (surface, x, y)
TypeError: must be cairo.Surface, not ImageSurface |
Can I close #6562 then? |
@QuLogic Can you do the 2.x into master merge? |
Neither commit message indicates it should be closed, so that did nothing. But I ask because there are some items unchecked here... |
oh, yes, close this. We decided that those platforms are not a) already broken on 1.5 and b) old c) otherwise non-functional |
WIP solution to #6562
Call cairo.ImageSurface.create_for_data with an array that both py2cairo and cairocffi knows how to get a pointer too and size of.
This seems to correctly resolve the issue for the
Cairo
backend but not the GTK(3)Cairo backends.Current status