matplotlib.widgets.ToolLineHandles#
- classmatplotlib.widgets.ToolLineHandles(ax,positions,direction,*,line_props=None,useblit=True)[source]#
Control handles for canvas tools.
- Parameters:
- ax
Axes Matplotlib Axes where tool handles are displayed.
- positions1D array
Positions of handles in data coordinates.
- direction{"horizontal", "vertical"}
Direction of handles, either 'vertical' or 'horizontal'
- line_propsdict, optional
Additional line properties. See
Line2D.- useblitbool, default: True
Whether to use blitting for faster drawing (if supported by thebackend). See the tutorialFaster rendering by using blittingfor details.
- ax
Methods
__init__(ax, positions, direction, *[, ...])closest(x, y)Return index and pixel distance to closest handle.
remove()Remove the handles artist from the figure.
set_animated(value)Set the animated state of the handles artist.
set_data(positions)Set x- or y-positions of handles, depending on if the lines are vertical or horizontal.
set_visible(value)Set the visibility state of the handles artist.
Attributes
Direction of the handle: 'vertical' or 'horizontal'.
Positions of the handle in data coordinates.
- propertyartists#
- closest(x,y)[source]#
Return index and pixel distance to closest handle.
- Parameters:
- x, yfloat
x, y position from which the distance will be calculated todeterminate the closest handle
- Returns:
- index, distanceindex of the handle and its distance from
position x, y
- propertydirection#
Direction of the handle: 'vertical' or 'horizontal'.
- propertypositions#
Positions of the handle in data coordinates.