Example #1
0
    def redo(self, axes):
        """
        Rezooms the axes.
        """
        if not self.can_redo(axes): return

        x, y = self._get_redo_history(axes).pop()
        return AxesLimits.set(self, axes, x, y)
Example #2
0
 def set(self, axes, xrange, yrange):
     """
     Override base class functionality to clear redo history.
     """
     if not self.zoomed(axes):
         for i in self._get_redo_history(axes):
             self._get_redo_history(axes).pop()
     return AxesLimits.set(self, axes, xrange, yrange)
Example #3
0
 def restore(self, axes):
     """
     Override base class functionality to add action to redo history.
     """
     if self.zoomed(axes):
         self._get_redo_history(axes).append((axes.get_xlim()
                                            , axes.get_ylim()))
     return AxesLimits.restore(self, axes)
Example #4
0
 def set(self, axes, xrange, yrange):
     """
     Override base class functionality to clear redo history.
     """
     if not self.zoomed(axes):
         for i in self._get_redo_history(axes):
             self._get_redo_history(axes).pop()
     return AxesLimits.set(self, axes, xrange, yrange)
Example #5
0
    def redo(self, axes):
        """
        Rezooms the axes.
        """
        if not self.can_redo(axes): return

        x, y = self._get_redo_history(axes).pop()
        return AxesLimits.set(self, axes, x, y)
Example #6
0
    def restore(self, axes):
        """
        Override base class functionality to add action to redo history.
        """
        if self.zoomed(axes):
            self._get_redo_history(axes).append(
                (axes.get_xlim(), axes.get_ylim()))

        return AxesLimits.restore(self, axes)
Example #7
0
 def __init__(self):
     AxesLimits.__init__(self)
     self.redo_history = weakref.WeakKeyDictionary()
Example #8
0
 def __init__(self):
     autoscaleUnzoom = False  # changed in wxmpl 1.3.0
     AxesLimits.__init__(self, autoscaleUnzoom)
     self.redo_history = weakref.WeakKeyDictionary()