Skip to content

Planar visualization API

pyvoro2.viz2d

Optional matplotlib-based visualization helpers for planar tessellations.

plot_tessellation(cells, *, ax=None, domain=None, show_sites=False, annotate_ids=False)

Plot planar cells using matplotlib.

Parameters:

Name Type Description Default
cells Iterable[dict]

Iterable of raw 2D cell dictionaries as returned by pyvoro2.planar.compute or pyvoro2.planar.ghost_cells.

required
ax Axes | None

Optional existing matplotlib axes.

None
domain _SupportsPlanarBounds | None

Optional planar domain. When it exposes bounds, the domain rectangle is drawn as a simple outline.

None
show_sites bool

If True, draw the reported cell sites.

False
annotate_ids bool

If True, label cell IDs at their reported sites.

False

Returns:

Type Description
tuple[Figure, Axes]

(fig, ax).

:::