API Reference#

The anyplotlib public API is organized into the sections 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 & Layout

Axes and the five plot classes (Plot1D, Plot2D, PlotMesh, Plot3D, PlotBar), plus GridSpec and SubplotSpec for multi-panel layouts.

Axes, Plots & Layout

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 event engine and the flat Event dataclass. See Event System for the full event-system guide.

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 handler store.

Event

A single interactive event with all payload fields as typed attributes.