| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/matplotlib.widgets.PolygonSelector.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
Select a polygon region of an Axes.
Place vertices with each mouse click, and make the selection by completing the polygon (clicking on the first vertex). Once drawn individual vertices can be moved by clicking and dragging with the left mouse button, or removed by clicking the right mouse button.
In addition, the following modifier keys can be used:
Hold ctrl and click and drag a vertex to reposition it before the polygon has been completed.
Hold the shift key and click and drag anywhere in the Axes to move all vertices.
Press the esc key to start a new polygon.
For the selector to remain responsive you must keep a reference to it.
AxesThe parent Axes for the widget.
When a polygon is completed or modified after completion,
the onselect function is called and passed a list of the vertices as
(xdata, ydata) tuples.
Whether to use blitting for faster drawing (if supported by the backend). See the tutorial Faster rendering by using blitting for details.
Properties with which the line is drawn, see Line2D for valid properties.
Default:
dict(color='k', linestyle='-', linewidth=2, alpha=0.5)
Artist properties for the markers drawn at the vertices of the polygon.
See the marker arguments in Line2D for valid
properties. Default values are defined in mpl.rcParams except for
the default value of markeredgecolor which will be the same as the
color property in props.
A vertex is selected (to complete the polygon or to move a vertex) if the mouse click is within grab_range pixels of the vertex.
If True, a bounding box will be drawn around the polygon selector
once it is complete. This box can be used to move and resize the
selector.
Properties to set for the box handles. See the documentation for the
handle_props argument to RectangleSelector for more info.
Properties to set for the box. See the documentation for the props
argument to RectangleSelector for more info.
Notes
If only one point remains after removing points, the selector reverts to an incomplete state and you can start drawing a new polygon from the existing point.
Examples
Polygon Selector Select indices from a collection using polygon selector
The polygon vertices, as a list of (x, y) pairs.
matplotlib.widgets.PolygonSelector#Select indices from a collection using polygon selector
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-1-g879ad8ebba.
Built with the PyData Sphinx Theme 0.16.1.
| Web Proxy Viewer | New URL | Original Page |