Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 7
0
 def __init__(self):
     AxesLimits.__init__(self)
     self.redo_history = weakref.WeakKeyDictionary()
Exemplo n.º 8
0
 def __init__(self):
     autoscaleUnzoom = False  # changed in wxmpl 1.3.0
     AxesLimits.__init__(self, autoscaleUnzoom)
     self.redo_history = weakref.WeakKeyDictionary()