code: def scale_image(self):
          
          new_width = int(self.figcanvas.fwidth *
                          self._scalestep ** self._scalefactor)
          new_height = int(self.figcanvas.fheight *
                           self._scalestep ** self._scalefactor)
          self.figcanvas.setFixedSize(new_width, new_height)
docs: Scale the image size.