Actually, I am programming a function to zoom only on y or x.
I already have a function to zoom.
When I zoom, I create first rectangle area with my cursor and I will zoom on this area.
Here is the part of my code to create the rectangle area:
zdc = wx.ClientDC(self.canvas)
zdc.SetLogicalFunction(wx.XOR)
zdc.SetBrush(wx.TRANSPARENT_BRUSH)
zdc.SetPen(wx.Pen('White', 2, wx.SOLID))
zdc.ResetBoundingBox()
if not is_wxPhoenix:
zdc.BeginDrawing()
# erase previous box
if self.rbbox is not None:
zdc.DrawRectangle(*self.rbbox)
`self.rbbox = (x0, y0, width, height)`
zdc.DrawRectangle(*self.rbbox)
if not is_wxPhoenix:
zdc.EndDrawing()
This is the line self.rbbox = (x0, y0, width, height)
which contains the coordinates. In zoom on x mode, I would like to get back the values of my y0 and ymax to create a rectangular area on my plot. Is it more clear ?
I have seen that I can get back height with self.canvas.figure.bbox.height
.
And sorry again about multiple forums, I have first created my post in the google group and have seen after that that this forum replaced the google group, that’s why I published on this group after. I thought that the google group was not used anymore.