anyplotlib.markers.MarkerRegistry#

class anyplotlib.markers.MarkerRegistry(push_fn, allowed=None)[source]#

Bases: object

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

Usage:

plot.markers["circles"]["group1"].set(offsets=new_offsets)

plot.markers is a MarkerRegistry. Indexing by type returns a MarkerTypeDict (auto-created on first access).

Parameters:

allowed (frozenset | None)

add(marker_type, name=None, **kwargs)[source]#

Add a marker group, returning the MarkerGroup.

Parameters:
  • marker_type (str) – Type string, e.g. 'circles', 'lines', 'arrows'.

  • name (str, optional) – Group name. Auto-generated ('circles_1' etc.) if None.

  • **kwargs (dict) – Matplotlib-style kwargs for the group (offsets, radius, colors, etc.).

Returns:

The created marker group. Call .set() to update, or access properties as attributes.

Return type:

MarkerGroup

Examples

>>> group = registry.add("circles", name="my_circles", offsets=[[10, 20]], radius=5)
>>> group.set(radius=8)
remove(marker_type, name)[source]#

Remove a named marker group and trigger re-render.

Parameters:
  • marker_type (str) – Type of the group.

  • name (str) – Name of the group to remove.

Raises:

KeyError – If the type or name is not found.

Return type:

None

clear()[source]#

Remove all markers of all types and trigger re-render.

Return type:

None

to_wire_list()[source]#

Flatten the full registry to a list of wire-format dicts.

Returns:

Wire-format dicts ready for JSON serialization and JS rendering.

Return type:

list of dict