anyplotlib.markers.MarkerGroup#

class anyplotlib.markers.MarkerGroup(marker_type, name, kwargs, push_fn, parent=None)[source]#

Bases: object

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

Parameters:
  • marker_type (str) – One of the supported marker types ('circles', 'lines', …).

  • name (str) – User-facing name (key in the parent MarkerTypeDict).

  • kwargs (dict) – Initial matplotlib-style kwargs for this group.

  • push_fn (callable) – Zero-arg callback that serialises the full registry and pushes it to the parent figure trait.

  • parent (MarkerTypeDict | None)

property marker_type: str#

The marker type, e.g. "circles" or "lines" (read-only).

property name: str#

The group’s key in plot.markers[marker_type] (read-only).

get(key, default=None)[source]#

Return a property as last given to the constructor or set() (matplotlib-style name, in the group’s coords frame).

>>> group.get("edgecolors")
'#ff0000'
Parameters:

key (str)

property coords: str#

"pixel" or "data".

Only meaningful for transform="data" groups on a 2-D image panel, where "pixel" (the default) means image pixels and "data" the calibrated axis values. On 1-D panels both mean data coordinates. Change it with group.set(coords=...); the stored values are then reinterpreted, not converted.

Type:

Frame of this group’s positions and lengths

set(**kwargs)[source]#

Update one or more properties and push the change to the plot.

Parameters:

**kwargs (dict) – Properties to update (e.g., offsets, radius, facecolors). Matplotlib-style names are translated to wire format. Positions and lengths are read in the group’s coords frame.

Return type:

None

remove()[source]#

Remove this group from its parent and trigger a re-render.

Return type:

None

to_wire(group_id)[source]#

Return a dict in the JS wire format for this marker group.

Parameters:

group_id (str) – Unique identifier for this marker group (usually UUID).

Returns:

Wire-format dict with type-specific structure, ready for JSON serialization and transmission to the JavaScript renderer.

Return type:

dict