STY: Switch order of callback parameters

This commit is contained in:
Tony S Yu
2012-12-13 14:29:14 -05:00
parent 19e86ed661
commit 7dcb2df3fc
2 changed files with 16 additions and 6 deletions
+9 -3
View File
@@ -12,18 +12,24 @@ __all__ = ['LineTool', 'ThickLineTool']
class LineTool(CanvasToolBase):
"""
"""Widget for line selection in a plot.
Parameters
----------
on_move : function
Function accepting end points of line as the only argument.
Function called whenever a control handle is moved.
This function must accept the end points of line as the only argument.
on_release : function
Function called whenever the control handle is released.
on_enter : function
Function called whenever the "enter" key is pressed.
Attributes
----------
end_pts : 2D array
End points of line ((x1, y1), (x2, y2)).
"""
def __init__(self, ax, x, y, on_move=None, on_enter=None, on_release=None,
def __init__(self, ax, x, y, on_move=None, on_release=None, on_enter=None,
maxdist=10, lineprops=None):
super(LineTool, self).__init__(ax, on_move=on_move, on_enter=on_enter,
on_release=on_release)
+7 -3
View File
@@ -19,9 +19,13 @@ class RectangleTool(mwidgets.RectangleSelector, CanvasToolBase):
Parameters
----------
ax : :class:`matplotlib.axes.Axes
on_move : function
Function called whenever a control handle is moved.
This function must accept the rectangle extents as the only argument.
on_release : function
Function called whenever the control handle is released.
on_enter : function
Function accepting rectangle extents as the only argument; called
whenever "Enter" key is pressed. If None, print extents of rectangle.
Function called whenever the "enter" key is pressed.
maxdist : float
Maximum distance in pixels for selection of a control handle
(i.e. corner or edge) handle.
@@ -35,7 +39,7 @@ class RectangleTool(mwidgets.RectangleSelector, CanvasToolBase):
Rectangle extents: (xmin, xmax, ymin, ymax).
"""
def __init__(self, ax, on_move=None, on_enter=None, on_release=None,
def __init__(self, ax, on_move=None, on_release=None, on_enter=None,
maxdist=10, rectprops=None):
CanvasToolBase.__init__(self, ax, on_move=on_move,
on_enter=on_enter, on_release=on_release)