fastplotlib.NDGraphic#

class NDGraphic(nd_subplot, name)[source]#

Base class that pairs an NDSlicer with a Graphic. Subclass to support a new graphical representation.

The NDSlicer produces the data slice for the current index and the NDGraphic writes it to the Graphic. When the ReferenceIndex of the parent NDWidget changes, it schedules _set_indices_() on every NDGraphic that has the dim that changed.

Subclasses must implement _create_graphic() and _set_indices_(), and the slicer, graphic, indices and display_dims properties. Most of the slicer properties are aliased here so users can reach them from the NDGraphic, and setting one of those aliases re-renders the current slice.

Parameters:
  • nd_subplot (NDWSubplot) – parent NDWSubplot the NDGraphic is in

  • name (str or None) – Name for this NDGraphic, used to retrieve it with nd_subplot[name].