From: Arnaud G. <ar...@os...> - 2014-11-11 21:51:01
|
Le mardi 11 novembre 2014 à 08:56 +0000, Jens Nielsen a écrit : > There was an issue with the GTK3Agg backend on Python 3 due to a > missing feature in the python 3 port of PyCairo but this has been > fixed in Matplotlib 1.4.0 by making it possible to use cairocffi as an > alternative to PyCairo. This is exactly the issue I meant. (...) > On Mon, Nov 10, 2014 at 11:26 PM, Thomas Caswell <tca...@gm...> > wrote: (...) > The issue is that the cairo backend is a vector backend, which > does not have a notion of blitting, which is something that > span selector uses to make it nice and snappy. Should be able > to get it to work by passing the kwarg `useblit=False` to the > constructor. > > Tom In fact I stupidly copied the example [1], missing completely this argument in the constructor. Setting useblit=False makes it working nicely. Thanks. Arnaud. [1] http://matplotlib.org/examples/widgets/span_selector.html PS: For the records, here is the full message that appears when setting useblit=True in [1] and matplotlibrc contains "backend : GTK3Cairo", matplotlib version 1.4.2 (debian): $ ./testspan.py Traceback (most recent call last): File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3cairo.py", line 45, in on_draw_event self._render_figure(w, h) File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3cairo.py", line 34, in _render_figure self.figure.draw (self._renderer) File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1085, in draw self.canvas.draw_event(renderer) File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 1778, in draw_event self.callbacks.process(s, event) File "/usr/lib/python3/dist-packages/matplotlib/cbook.py", line 540, in process proxy(*args, **kwargs) File "/usr/lib/python3/dist-packages/matplotlib/cbook.py", line 415, in __call__ return mtd(*args, **kwargs) File "/usr/lib/python3/dist-packages/matplotlib/widgets.py", line 1197, in update_background self.background = self.canvas.copy_from_bbox(self.ax.bbox) AttributeError: 'FigureCanvasGTK3Cairo' object has no attribute 'copy_from_bbox' |