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:Anythe sub-primitives to draw in the inset
position:Anythe inset’s anchor position in the parent
offset:Anythe anchor’s alignment within the inset box
dimensions:Anythe inset’s
(width, height)(inferred from the sub-primitives if omitted)plot_range:Anythe inset’s data range (inferred if omitted)
opts:Anyextra 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:listthe
[(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:listthe
[(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:tuplethe 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:Anythe parent graphics (used for aspect correction)
preserve_aspect:bool | Nonepreserve the sub-primitives’ aspect ratio
:returns:listthe
[[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:Anythe parent graphics
bbox:Anythe inset bounding box (computed if omitted)
opts:Anyoptions 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:Anythe axes (or graphics) to draw onto
args:Anyextra positional arguments
graphics:Anythe parent graphics (defaults to
axes)kwargs:Anyextra options
:returns:listthe drawn sub-primitives