draw_marquee
- draw_marquee(frame_xlim: ~typing.Tuple[float, float], frame_ylim: ~typing.Tuple[float, float], ax: ~matplotlib.axes._axes.Axes | None = None, *, color: str | None = 'blue', clip_on: bool = False, despine: bool = True, frame_edge_kws: ~typing.Dict = frozendict.frozendict({}), frame_face_kws: ~typing.Dict = frozendict.frozendict({}), frame_inner_pad: float | ~typing.Tuple[float, float] = 0.0, frame_outer_pad: float | ~typing.Tuple[float, float] = 0.1, label: str | None = None, leader_edge_kws: ~typing.Dict = frozendict.frozendict({}), leader_face_kws: ~typing.Dict = frozendict.frozendict({}), leader_stretch: float = 0.2, leader_stretch_unit: ~typing.Literal['axes', 'figure', 'inches', 'inchesfrom'] = 'inches', leader_tweak: ~typing.Callable = <function <lambda>>, mark_glyph: ~typing.Callable | None = <function mark_magnifying_glass>, mark_glyph_kws: ~typing.Dict = frozendict.frozendict({}), mark_retract: float = 0.1, zorder: float = 0) Axes [source]
Mark a rectangular region on a matplotlib axes object, framing it with a zoom-effect callout.
Consists of (1) a rectangular frame (2) a callout leader, and (3) a marked glyph. The rectangular frame consists of an outer of border and an underlaid solid color fill. The leader is a gradient fill clipped to angle to a point up and to to the right of the framed region. The marked glyph (e.g., a numeral, an asterisk, etc.) is drawn at the vertex point of the leader.
The callout is capped by a customizable glyph, default as a magnifying glass.
- Parameters:
frame_xlim (Tuple[float, float]) – X-limits (xmin, xmax) of the area to be marked as outset.
frame_ylim (Tuple[float, float]) – Y-limits (ymin, ymax) of the area to be marked as outset.
ax (matplotlib.axes.Axes, optional) – Axes object to draw the outset on. Defaults to plt.gca().
color (str, optional) – Color for the frame’s edge and zoom indication lines.
clip_on (bool, default False) – If True, drawing elements are clipped to the axes bounding box.
despine (bool, default True) – If True, removes top and right spines from the plot.
frame_edge_kws (Dict, default {}) –
Customization arguments for the frame’s edge.
Standard matplotlib styling is supported (linewidth, linestyle, etc.).
frame_face_kws (Dict, default {}) –
Customization arguments for the frame’s face.
Standard matplotlib styling is supported (facecolor, alpha, etc.).
frame_inner_pad (Union[float, Tuple[float, float]], default 0.0) – Padding from data extent to frame boundary, calculated relative to data extent (float) or in absolute units (tuple).
frame_outer_pad (Union[float, Tuple[float, float]], default 0.1) – Padding from frame boundary to axis viewport, calculated relative to data extent (float) or in absolute units (tuple).
label (str, optional) – Label used for legend creation.
leader_edge_kws (Dict, default {}) –
Customization arguments for the leader’s edge.
Standard matplotlib styling is supported (linewidth, linestyle, etc.).
leader_face_kws (Dict, default {}) –
Customization arguments for the leader’s face.
Standard matplotlib styling is supported (facecolor, alpha, etc.).
leader_stretch (float, default 0.1) – Size of callout leader in leader_stretch_unit.
leader_stretch_unit (Literal['axes', 'figure', 'inches', 'inchesfrom'], default 'axes') –
How should callout leader placement be determined?
If ‘axes’ or ‘figure’, stretch is specified as a fraction of the axes or figure size, respectively. If ‘inches’, stretch is specified in inches. If ‘inchesfrom’, stretch is minimum necessary to place the marker leader_stretch inches from the lower left corner of the frame.
leader_tweak (Callable, default identity) – Callable to modify the callout leader vertices before drawing.
mark_glyph (Callable, optional) –
A callable to draw a glyph at the outer vertex of the callout leader.
If None, no glyph is drawn.
mark_glyph_kws (Dict, default frozendict.frozendict()) –
Arguments for the mark_glyph callable.
Standard matplotlib styling is supported (markersize, color, etc.).
mark_retract (float, default 0.1) – Fraction to pull back glyph from the outer vertex of the callout.
zorder (float, default 0) – Z-order for layering plot elements.
- Returns:
Axes with the outset and annotations added.
- Return type:
matplotlib.axes.Axes
Notes
Delegates to _auxlib.draw_callout_.draw_callout and _auslib.draw_callout_.draw_frame for drawing.
See also
outset.marqueeplot
Axes-level tidy data interface for creating marquee annotations.
outset.OutsetGrid
Figure-level interface for creating plots with marquee annotations.