Pan/Zoom can't work with blitting

Hi,

To improve plotting speed, I decided to use blitting(canvas.copy_from_bbox(), canvas.restore_region() & canvas.blit()) instead of canvas.draw(), however panning & zooming stops working after this change. Now, when I click on the ‘Pan/Zoom’ button or the ‘Zoom to rectangle’ button on the Navigation Toolbar, my plot becomes empty. I don’t know what’s going wrong, can someone please point me in the right direction?

Thank you,

Clare.

Hi Clare,
Which backend are you using, and can you show an example script?
The blitting functions are a bit unusual as they try to draw stuff to the figure outside of the event loop. This is e.g. causing problems with animations, which makes use of the blitting functions. We have been looking at that recently (see macosx backend does not work with blitting · Issue #531 · matplotlib/matplotlib · GitHub) but we haven’t come up with a solution yet. Solving this issue may also fix your problem (which sounds like an event loop problem), so you may want to follow issue 531.
Best,
-Michiel.

···

— On Thu, 4/11/13, Clare Soh <clare07112002@…1003…7…> wrote:

From: Clare Soh <clare07112002@…287…>
Subject: [Matplotlib-users] Pan/Zoom can’t work
with blitting
To: “matplotlib-users@lists.sourceforge.netmatplotlib-users@lists.sourceforge.net
Date: Thursday, April 11, 2013, 5:19 AM

Hi,

To improve plotting speed, I decided to use blitting(canvas.copy_from_bbox(), canvas.restore_region() & canvas.blit()) instead of canvas.draw(), however panning & zooming stops working after this change. Now, when I click on the ‘Pan/Zoom’ button or the ‘Zoom to rectangle’ button on the Navigation Toolbar, my plot becomes empty. I don’t know what’s going wrong, can someone please point me in the right direction?

Thank you,

Clare.

-----Inline Attachment Follows-----


Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

-----Inline Attachment Follows-----


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi Michiel,

I’m using GtkAgg. Please correct me if I’m wrong, but issue 531’s problem is with blitting, for me blitting works, I’m able to speed up plotting using canvas.copy_from_bbox(), canvas.restore_region() & canvas.blit(). It’s just that after plotting, if I try to pan or zoom using the pan/zoom buttons on the navigation toolbar, whatever I’ve plotted disappears & the whole thing becomes blank. I’m able to pan/zoom if I use canvas.draw() but plotting is too slow because it redraws everything.

Regards,

Clare.

···

On Fri, Apr 12, 2013 at 8:22 AM, Michiel de Hoon <mjldehoon@…9…> wrote:

Hi Clare,
Which backend are you using, and can you show an example script?
The blitting functions are a bit unusual as they try to draw stuff to the figure outside of the event loop. This is e.g. causing problems with animations, which makes use of the blitting functions. We have been looking at that recently (see https://github.com/matplotlib/matplotlib/issues/531) but we haven’t come up with a solution yet. Solving this issue may also fix your problem (which sounds like an event loop problem), so you may want to follow issue 531.
Best,
-Michiel.
— On Thu, 4/11/13, Clare Soh <clare07112002@…2015…87…> wrote:

From: Clare Soh <clare07112002@…287…>
Subject: [Matplotlib-users] Pan/Zoom can’t work with blitting

To: “matplotlib-users@lists.sourceforge.netmatplotlib-users@lists.sourceforge.net

Date: Thursday, April 11, 2013, 5:19 AM

Hi,

To improve plotting speed, I decided to use blitting(canvas.copy_from_bbox(), canvas.restore_region() & canvas.blit()) instead of canvas.draw(), however panning & zooming stops working after this change. Now, when I click on the ‘Pan/Zoom’ button or the ‘Zoom to rectangle’ button on the Navigation Toolbar, my plot becomes empty. I don’t know what’s going wrong, can someone please point me in the right direction?

Thank you,

Clare.

-----Inline Attachment Follows-----


Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building

apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

-----Inline Attachment Follows-----


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users