Also add handle style to ThickLineTool

This commit is contained in:
Stefan van der Walt
2014-09-30 06:18:03 +02:00
parent 8a914e55f1
commit 63c92537b1
2 changed files with 8 additions and 3 deletions
+6 -2
View File
@@ -151,6 +151,9 @@ class ThickLineTool(LineTool):
Maximum pixel distance allowed when selecting control handle.
line_props : dict
Properties for :class:`matplotlib.lines.Line2D`.
handle_props : dict
Marker properties for the handles (also see
:class:`matplotlib.lines.Line2D`).
Attributes
----------
@@ -159,13 +162,14 @@ class ThickLineTool(LineTool):
"""
def __init__(self, viewer, on_move=None, on_enter=None, on_release=None,
on_change=None, maxdist=10, line_props=None):
on_change=None, maxdist=10, line_props=None, handle_props=None):
super(ThickLineTool, self).__init__(viewer,
on_move=on_move,
on_enter=on_enter,
on_release=on_release,
maxdist=maxdist,
line_props=line_props)
line_props=line_props,
handle_props=handle_props)
if on_change is None:
def on_change(*args):
+2 -1
View File
@@ -104,7 +104,8 @@ def test_thick_line_tool():
img = data.camera()
viewer = ImageViewer(img)
tool = ThickLineTool(viewer, maxdist=10)
tool = ThickLineTool(viewer, maxdist=10, line_props=dict(color='red'),
handle_props=dict(markersize=5))
tool.end_points = get_end_points(img)
do_event(viewer, 'scroll', button='up')