matplotlib.widgets#

Widgets that are designed to work for any of the GUI backends.

All of these widgets require you to predefine anAxesinstance and pass that as the first parameter. Matplotlib doesn't try tobe too smart with respect to layout -- you will have to figure out howwide and tall you want your Axes to be to accommodate your widget.

Widget classes#

Inheritance diagram of matplotlib.widgets.Widget

Widget

Abstract base class for GUI neutral widgets.

AxesWidget

Widget connected to a singleAxes.

Cursor

A crosshair cursor that spans the Axes and moves with mouse cursor.

MultiCursor

Provide a vertical (default) and/or horizontal line cursor shared between multiple Axes.

Button

A GUI neutral button.

_Buttons

The base class forCheckButtons andRadioButtons.

CheckButtons

A GUI neutral set of check buttons.

RadioButtons

A GUI neutral radio button.

SliderBase

The base class for constructing Slider widgets.

Slider

A slider representing a floating point range.

RangeSlider

A slider representing a range of floating point values.

TextBox

A GUI neutral text input box.

_SelectorWidget

The base class for selector widgets.

RectangleSelector

Select a rectangular region of an Axes.

EllipseSelector

Select an elliptical region of an Axes.

Lasso

Selection curve of an arbitrary shape.

LassoSelector

Selection curve of an arbitrary shape.

PolygonSelector

Select a polygon region of an Axes.

SpanSelector

Visually select a min/max range on a single axis and call a function with those values.

SubplotTool

A tool to adjust the subplot params of aFigure.

Helper classes#

LockDraw

Some widgets, like the cursor, draw onto the canvas, and this is not desirable under all circumstances, like when the toolbar is in zoom-to-rect mode and drawing a rectangle.

ToolHandles

Control handles for canvas tools.

ToolLineHandles

Control handles for canvas tools.