marqueeplot
- marqueeplot(data: ~pandas.core.frame.DataFrame, *, x: str, y: str, hue: str | None = None, hue_order: ~typing.Sequence[str] | None = None, outset: str | None = None, outset_order: ~typing.Sequence[str] | None = None, ax: ~matplotlib.axes._axes.Axes | None = None, color: str | None = None, frame_inner_pad: float | ~typing.Tuple[float, float] = 0.1, frame_outer_pad: float | ~typing.Tuple[float, float] = 0.1, frame_outer_pad_unit: ~typing.Literal['axes', 'figure', 'inches'] = 'axes', leader_tweak: ~typing.Callable | ~typing.Type = <function <lambda>>, mark_glyph: ~typing.Callable | ~typing.Type | None = <class 'outset.mark._MarkNumericalBadges.MarkNumericalBadges'>, palette: ~typing.Sequence | None = None, preserve_aspect: bool | None = False, tight_axlim: bool = False, **kwargs) Axes [source]
Plot marquee annotations to contain subsets of data from a pandas DataFrame.
Provides a seaborn-like axis-level interface for draw_marquee. Details on marquee annotation structure and configuration can be found in that function’s docstring.
- Parameters:
data (pd.DataFrame) – DataFrame containing the data to be marquee-annotated.
x (str) – Column name in data for x-coordinate values of data positions.
y (str) – Column name in data for y-coordinate values of data positions.
hue (str, optional) –
Column name in data for grouping data by color.
If provided, colors are chosen according to palette.
hue_order (Sequence[str], optional) – Order for plotting the categorical levels of hue.
outset (str, optional) – Column name in data for producing different-colored annotated subsets.
outset_order (Sequence[str], optional) – Order for plotting the categorical levels of outset.
ax (mpl_axes.Axes, optional) – Matplotlib Axes object to draw the plot on.
color (str, optional) – Color for all elements in the plot, overriding the palette.
frame_inner_pad (Union[float, Tuple[float, float]], default 0.1) – Padding from data range to rectangular boundary.
frame_outer_pad (Union[float, Tuple[float, float]], default 0.1) – Padding from frame boundary to axis viewport.
frame_outer_pad_unit (Literal["axes", "figure", "inches"], default "axes") –
How should outer padding be specified?
If ‘axes’ or ‘figure’, padding is specified as a fraction of the axes or figure size, respectively. If ‘inches’, padding is specified in inches.
leader_tweak (Callable, default identity) – Callable or functor type to modify the callout leader vertices before drawing.
mark_glyph (Union[Callable, Type, None], optional) – Callable or functor type to draw a glyph at the end of the callout.
palette (Sequence, optional) – Color palette for plotting elements.
preserve_aspect (bool, default False) – If True, finalizing by applying initial axes aspect. If None, restore initial axes aspect unless axes are unset.
tight_axlim (bool, default False) – Whether to shrink axes limits to fit data range.
**kwargs (dict) –
Keyword arguments to adjust marquee sizing and styling.
See outset.draw_marquee for available options.
- Returns:
The Matplotlib axes containing the plot with annotated regions.
- Return type:
matplotlib.axes.Axes
See also
outset.OutsetGrid
Figure-level interface for creating plots with marquee annotations.
outset.draw_marquee
Low-level function for drawing marquee annotations.