Inset

 

__init__(self, prims, position, offset=(0.5, 0.5), dimensions=None, plot_range=None, **opts): 

LLM Docstring

Set up an inset primitive: a group of sub-primitives placed in their own inset axes at a position within the parent.

  • prims: Any

    the sub-primitives to draw in the inset

  • position: Any

    the inset’s anchor position in the parent

  • offset: Any

    the anchor’s alignment within the inset box

  • dimensions: Any

    the inset’s (width, height) (inferred from the sub-primitives if omitted)

  • plot_range: Any

    the inset’s data range (inferred if omitted)

  • opts: Any

    extra options for the inset axes

 

@property
plot_range(self): 

LLM Docstring

The inset’s data range (computed from the sub-primitives when not set).

  • :returns: list

    the [(left, right), (bottom, top)] range

 

get_plot_range(self): 

LLM Docstring

Compute the inset’s data range as the union of its sub-primitives’ bounding boxes.

  • :returns: list

    the [(left, right), (bottom, top)] range

 

@property
dimensions(self): 

LLM Docstring

The inset’s (width, height), derived from the data range (and filling in a missing dimension from the aspect ratio).

  • :returns: tuple

    the dimensions

 

get_bbox(self, graphics=None, preserve_aspect=None): 

LLM Docstring

Compute the inset’s bounding box in the parent’s coordinates, optionally correcting the height/width to preserve the sub-primitives’ aspect ratio.

  • graphics: Any

    the parent graphics (used for aspect correction)

  • preserve_aspect: bool | None

    preserve the sub-primitives’ aspect ratio

  • :returns: list

    the [[min_x, min_y], [max_x, max_y]] bounding box

 

get_axes(self, graphics, bbox=None, **opts): 

LLM Docstring

Create (and cache) the inset axes on the parent graphics for the given bounding box, closing any previous inset for that figure.

  • graphics: Any

    the parent graphics

  • bbox: Any

    the inset bounding box (computed if omitted)

  • opts: Any

    options for the inset axes

  • :returns: _

    the inset axes

 

plot(self, axes, *args, graphics=None, **kwargs): 

LLM Docstring

Draw the inset: create its axes on the parent and render (or re-host) each sub-primitive into it.

  • axes: Any

    the axes (or graphics) to draw onto

  • args: Any

    extra positional arguments

  • graphics: Any

    the parent graphics (defaults to axes)

  • kwargs: Any

    extra options

  • :returns: list

    the drawn sub-primitives


Feedback

Examples

Templates

Documentation