API Reference#

The anyplotlib public API is organized into five modules below. Click a card to browse the module page, or use the summary tables to jump directly to a class or function.

Figure

The Figure widget and the subplots() factory — the main entry point for creating interactive figures.

Figure

Axes & Plots

Axes and the five plot classes: Plot1D, Plot2D, PlotMesh, Plot3D, PlotBar.

Figure Plots

Layout

GridSpec and SubplotSpec for building flexible multi-panel figure layouts.

Figure Plots

Markers

Static visual overlays — circles, arrows, lines, rectangles, polygons, text, and more — drawn on top of any plot.

Markers

Interactive Widgets

Draggable overlays such as CrosshairWidget and RectangleWidget that report position back to Python.

Interactive Widgets

Callbacks

The CallbackRegistry two-tier event system (on_change for live frames, on_release for settled state) and the Event dataclass.

Callbacks

Figure#

Figure

Multi-panel interactive figure widget.

subplots

Create a Figure and a grid of Axes.

Axes & Plots#

Axes

A single grid cell in a Figure.

Plot1D

1-D line plot panel returned by Axes.plot().

Plot2D

2-D image plot panel.

PlotMesh

2-D mesh plot panel created by Axes.pcolormesh().

Plot3D

3-D plot panel.

PlotBar

Bar-chart plot panel.

Layout#

GridSpec

Define a grid of subplot cells.

SubplotSpec

Describes which grid cells a subplot occupies.

Markers#

MarkerGroup

A named collection of markers of one type on one plot.

MarkerTypeDict

Dict-like container for all named groups of one marker type.

MarkerRegistry

Top-level two-level marker registry for a plot.

Interactive Widgets#

Widget

Base class for all overlay widgets.

RectangleWidget

Draggable rectangle overlay widget for 2-D plots.

CircleWidget

Draggable circle overlay widget for 2-D plots.

AnnularWidget

Draggable annular (ring) overlay widget for 2-D plots.

CrosshairWidget

Draggable crosshair overlay widget for 2-D plots.

PolygonWidget

Draggable polygon overlay widget for 2-D plots.

LabelWidget

Text label overlay widget for 2-D plots.

VLineWidget

Draggable vertical line overlay widget for 1-D plots.

HLineWidget

Draggable horizontal line overlay widget for bar charts.

RangeWidget

Draggable range selection widget.

Callbacks#

CallbackRegistry

Per-object registry for on_click / on_changed / on_release / on_key / on_line_hover / on_line_click callbacks.

Event

A single interactive event.