FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix image plotting in Cairo backends by jenshnielsen · Pull Request #6602 · matplotlib/matplotlib · GitHub

Repository navigation

Fix image plotting in Cairo backends - #6602

Merged
tacaswell merged 2 commits into
matplotlib:v2.xfrom
jenshnielsen:cairoimage
Jun 20, 2016
Merged

tacaswell merged 2 commits into
matplotlib:v2.xfrom
jenshnielsen:cairoimage

Conversation

jenshnielsen commented Jun 18, 2016 •
edited
Loading

Copy link
Copy Markdown
Member

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

  • Python2.7, Cairo backend, cairocffi
  • Python2.7, Cairo backend, py2cairo
  • Python3.5, Cairo backend, cairocffi
  • Python2.7, GTKCairo backend, cairocffi
  • Python2.7, GTKCairo backend, py2cairo
  • Python2.7, GTK3Cairo backend, cairocffi
  • Python2.7, GTK3Cairo backend, py2cairo
  • Python3.5, GTK3Cairo backend, cairocffi
  • Python3.5, Cairo backend, py3cairo non functional with latests release of py3cairo
  • Python3.5, GTKCairo backend, cairocffi python 3 NOT Supported by GTK2
  • Python3.5, GTKCairo backend, py3cairo python 3 NOT Supported by GTK2
  • Python3.5, GTK3Cairo backend, py3cairo non functional with latests release of py3cairo

Call cairo.ImageSurface.create_for_data with an array that both py2cairo and cairocffi knows how to get a pointer too and size of

Copy link
Copy Markdown
Member Author

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

Copy link
Copy Markdown
Member Author

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

tacaswell closed this Jun 18, 2016
tacaswell reopened this Jun 18, 2016
tacaswell added this to the 2.0 (style change major release) milestone Jun 20, 2016
tacaswell merged commit 003dea9 into matplotlib:v2.x Jun 20, 2016
jenshnielsen deleted the cairoimage branch June 21, 2016 06:36

QuLogic commented Jun 22, 2016

Copy link
Copy Markdown
Member

Can I close #6562 then?

Copy link
Copy Markdown
Member

@QuLogic Can you do the 2.x into master merge?

QuLogic commented Jun 22, 2016

Copy link
Copy Markdown
Member

Neither commit message indicates it should be closed, so that did nothing. But I ask because there are some items unchecked here...

Copy link
Copy Markdown
Member

oh, yes, close this. We decided that those platforms are not a) already broken on 1.5 and b) old c) otherwise non-functional

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL