| [ Web Proxy ] |
| Viewing: https://matplotlib.org/devdocs/api/toolkits/../_as_gen/matplotlib.widgets.SpanSelector.html | [Back] [Original] |
Section Navigation
matplotlibmatplotlib.animationmatplotlib.artistmatplotlib.axesmatplotlib.axismatplotlib.backend_basesmatplotlib.backend_managersmatplotlib.backend_toolsmatplotlib.backendsmatplotlib.backends.backend_mixedmatplotlib.backends.backend_templatematplotlib.backends.backend_aggmatplotlib.backends.backend_cairomatplotlib.backends.backend_gtk3agg, matplotlib.backends.backend_gtk3cairomatplotlib.backends.backend_gtk4agg, matplotlib.backends.backend_gtk4cairomatplotlib.backends.backend_nbaggmatplotlib.backends.backend_pdfmatplotlib.backends.backend_pgfmatplotlib.backends.backend_psmatplotlib.backends.registrymatplotlib.backends.backend_qtagg, matplotlib.backends.backend_qtcairomatplotlib.backends.backend_svgmatplotlib.backends.backend_tkagg, matplotlib.backends.backend_tkcairomatplotlib.backends.backend_webagg_corematplotlib.backends.backend_webaggmatplotlib.backends.backend_wxagg, matplotlib.backends.backend_wxcairomatplotlib.beziermatplotlib.categorymatplotlib.cbookmatplotlib.cmmatplotlib.collectionsmatplotlib.colorbarmatplotlib.colorizermatplotlib.colorsmatplotlib.containermatplotlib.contourmatplotlib.datesmatplotlib.dvireadmatplotlib.figurematplotlib.font_managermatplotlib.ft2fontmatplotlib.gridspec
matplotlib.hatchmatplotlib.imagematplotlib.insetmatplotlib.layout_enginematplotlib.legendmatplotlib.legend_handlermatplotlib.lines
matplotlib.markers
matplotlib.mathtextmatplotlib.mlabmatplotlib.offsetboxmatplotlib.patchesmatplotlib.pathmatplotlib.patheffectsmatplotlib.pyplotmatplotlib.projections
matplotlib.quiver
matplotlib.rcsetupmatplotlib.sankeymatplotlib.scalematplotlib.sphinxext.mathmplmatplotlib.sphinxext.plot_directivematplotlib.sphinxext.figmpl_directivematplotlib.sphinxext.rolesmatplotlib.spinesmatplotlib.stylematplotlib.tablematplotlib.testingmatplotlib.textmatplotlib.texmanagermatplotlib.tickermatplotlib.transformsmatplotlib.trimatplotlib.typingmatplotlib.unitsmatplotlib.widgetsmatplotlib._afmmatplotlib._apimatplotlib._docstringmatplotlib._enumsmatplotlib._type1fontmatplotlib._tight_bboxmatplotlib._tight_layoutmpl_toolkits.mplot3dmpl_toolkits.axes_grid1mpl_toolkits.axisartistpylabmatplotlib.widgetsBases: _SelectorWidget
Visually select a min/max range on a single axis and call a function with those values.
To guarantee that the selector remains responsive, keep a reference to it.
In order to turn off the SpanSelector, set span_selector.active to
False. To turn it back on, set it to True.
Press and release events triggered at the same coordinates outside the
selection will clear the selector, except when
ignore_event_outside=True.
Axesfunc(min: float, max: float)A callback function that is called after a release event and the selection is created, changed or removed.
The direction along which to draw the span selector.
If selection is less than or equal to minspan, the selection is removed (when already existing) or cancelled.
If True, use the backend-dependent blitting features for faster canvas updates. See the tutorial Faster rendering by using blitting for details.
Dictionary of Patch properties.
func(min: float, max: float), optionalCalled on mouse move while the span is being selected.
Whether to draw a set of handles that allow interaction with the widget after it is drawn.
MouseButton or list of MouseButton, default: all buttonsThe mouse buttons which activate the span selector.
Properties of the handle lines at the edges of the span. Only used
when interactive is True. See Line2D for valid properties.
Distance in pixels within which the interactive tool handles can be activated.
Keyboard modifiers which affect the widget's behavior. Values amend the defaults, which are:
"clear": Clear the current shape, default: "escape".
If True, the widget can be moved by clicking anywhere within its bounds.
If True, the event triggered outside the span selector will be ignored.
Snap the selector edges to the given values.
Examples
>>> import matplotlib.pyplot as plt
>>> import matplotlib.widgets as mwidgets
>>> fig, ax = plt.subplots()
>>> ax.plot([1, 2, 3], [10, 50, 100])
>>> def onselect(vmin, vmax):
... print(vmin, vmax)
>>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal',
... props=dict(facecolor='blue', alpha=0.5))
>>> fig.show()
See also: Span Selector
Direction of the span selector: 'vertical' or 'horizontal'.
The values, in data coordinates, for the start and end points of the current selection. If there is no selection then the start and end values will be the same.
matplotlib.widgets.SpanSelector#
Copyright 20022012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 20122026 The Matplotlib development team.
Created using Sphinx 9.1.0.
Built from v3.11.2-735-g07bae271c.
Built with the PyData Sphinx Theme 0.18.0.
| Web Proxy Viewer | New URL | Original Page |