Hi I am using blitting and am not able to get it to work as I want.
I am using copy_from_bbox during the setup of my PyQt GUI to save a meshgrid as a starting empty background. Then, once the GUI is loaded, the user can click on the meshgrid and a square is displayed on the selected pixel with blitting, so that no re-plotting needs to be done. The problem is that between the copy_from_bbox call and the final GUI setup, there is some movement of the widgets (don’t really know why, surely PyQt layout adjustments). This leads to a shift of the restored region, because the saved one (after the draw() call) is not the one which is finally displayed in the GUI. This can lead to strange display errors … I tried to trim down my code to the essential, I hope it’s short enough. I am using Matplotlib 1.3.1 on OS X, but I am having this problem one or two years and had never time to tackle it (I have it also on Windows and Fedora) Here is my code, just run it and click on the meshgrid, you will see it move down, so that the top of the red square is not drawn correctly. https://gist.github.com/iMichka/9901318 In the case of my example the shift is quite small (I could live with a shift of one pixel …), but in my real app there is more stuff and the shift is bigger … the plot even overlaps with PyQt buttons … Is there any way to call copy_from_bbox when the PyQt GUI has stabilized ? This means after the PyQt event loop has finished refreshing, and not before the refreshing ? Any help would be much appreciated :) Michka ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users