def on_scroll(self, event):
    '\n        Scroll event for zooming in/out\n        '
    if (event.inaxes != self.axes):
        return
    if (event.button == 'up'):
        self.zoom = max((0.9 * self.zoom), self.zoom_min)
    elif (event.button == 'down'):
        self.zoom = min((1.1 * self.zoom), self.zoom_max)
    self.axes.set_xlim((- self.zoom), self.zoom)
    self.axes.set_ylim((- self.zoom), self.zoom)
    self.figure.canvas.draw()
Scroll event for zooming in/out
def on_scroll(self, event):
    '\n        \n        '
    if (event.inaxes != self.axes):
        return
    if (event.button == 'up'):
        self.zoom = max((0.9 * self.zoom), self.zoom_min)
    elif (event.button == 'down'):
        self.zoom = min((1.1 * self.zoom), self.zoom_max)
    self.axes.set_xlim((- self.zoom), self.zoom)
    self.axes.set_ylim((- self.zoom), self.zoom)
    self.figure.canvas.draw()