mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-05 23:30:56 +08:00
STY: Switch order of callback parameters
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user