Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
WXAgg embedded navigation zoom, home, back not working #4109
I have a figure canvas and navigation bar embedded in a wx.Dialog. In matplotlib version 1.2.1 and earlier the zoom, home, back (and pan) all worked fine. If I upgrade to 1.3 (or 1.4.2) zoom, home, and back stop working. Only pan works. Any time I zoom, the zoom rectangle is drawn but nothing happens. The zoom rectangle remains on the screen after I release the mouse button. If I then switch to pan and left-click to pan the zoom takes effect. Same thing with the home and back buttons. If I click them nothing happens until I switch to pan and actually left click and pan then they take effect.
I also tried this with the user interface example: embedding_in_wx2.py
def OnShowClicked(self, event): frame = CanvasFrame() frame.Show(True)
The window shows correctly, but the zoom, home, back don't work just as I described above.
I looked through the changes between 1.2.1 and >=1.3 but I didn't see anything that would point to this. What changed between these versions that might causes this issue.
How do I work around this issue? Is there an example somewhere that shows the right way to do things now to get zoom, home, back, etc. working again?
I just made the 1.4.3 windows binaries visible https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.4.3/ 1.4.3rc1 is almost identical and would work too.
The home and back buttons work now as well. I see the zoom window has changed from a black rectangle to a purple translucent window. Nice. What else could have changed between 1.4.2 and 1.4.3 that could have made the issue go away?
That main issue is gone but a smaller zoom related one has now appeared. I have two subplots.
self.axes_1 = self.figure.add_subplot(211) self.axes_2 = self.figure.add_subplot(212)
Zooming in the top window the purple zoom rectangle is always drawn. Zooming in the bottom rectangle the purple zoom window is only sometimes drawn. I verified this on two machines.
Update: I have another graph with 3 subplots.
self.axes_1 = self.figure.add_subplot(311) self.axes_2 = self.figure.add_subplot(312) self.axes_3 = self.figure.add_subplot(313)
Zooming on the first/top two always draws the purple zoomed rectangle. The last one (bottom one) only draws it sometimes. They all always zoom, but the rectangle is not always drawn for the bottom graph. It is intermittent.