For AI agents: the complete XY documentation index is at llms.txt. Markdown versions are available by appending .md or sending Accept: text/markdown.
Components

/

Marks in Python

Marks in Python

A mark describes data geometry inside a chart. Factories such as line(), scatter(), and histogram() return lightweight Mark objects; the chart container resolves their data and compiles them into one figure.

Bind Arrays or Columns

Pass arrays directly for small, local examples:

Start Building Now!

For table-shaped data, pass column names and provide data= on the mark or once on the chart:

A mark-level data source overrides the chart-level source. Column-name resolution works with pandas, NumPy-compatible mappings, and Arrow-backed tables described in Data and columns. XY validates missing columns and incompatible channel lengths when the chart is built.

Choose a Mark Family

GeometryFactories
Trends and rangesline, area, step, stairs
Pointsscatter
Categoriesbar, column
Distributionshistogram/hist, ecdf, box, violin
Density and gridshexbin, heatmap, contour
Uncertaintyerrorbar, error_band
Explicit geometrystem, segments, triangle_mesh
Directed flowsribbon, sankey
Ordered processesfunnel

The Chart Gallery explains expected data shapes and family-specific choices.

Layer Marks in Declaration Order

Families mix freely inside one neutral xy.chart(...); children draw in declaration order, so the bars below come first and the trend line paints over them:

Start Building Now!

Shared Mark Behavior

  • name= gives a rendered series its legend label.
  • x_axis= and y_axis= bind a mark to primary or named axes.
  • Data-driven color and size channels are available where the mark supports them. Their domains and palettes remain mark configuration, not colorbar configuration.
  • style= is compiled for WebGL, SVG, and native raster output. Supported CSS declarations depend on the mark kind and invalid declarations fail early.
  • Children draw in declaration order, so broad fills normally come before lines and points.
  • key= supplies stable row identity for keyed browser data transitions, and mark-level animation= cascades over the chart's xy.animation() policy field by field — xy.animation(duration=90) on a mark changes only the duration — or disables that mark with animation=False. See Animations and data transitions.

Canvas and WebGL marks are not DOM elements. CSS selectors and Tailwind classes cannot paint their geometry; use style= or the mark's paint props. In particular, class_name= is adapter-only trace metadata, not a mark-painting hook in the shipped browser, Reflex, SVG, or native renderers. See Customize Each Part for the compiled CSS subset.

This example drives one scatter's color= and size= from a data column-like array (with colormap= and size_range= as mark configuration) while a second mark uses plain paint options — name=, color=, dash=, and opacity=:

Start Building Now!

Compose a Multi-Mark Figure

Everything above composes: an uncertainty band drawn with area(..., base=) goes first, the line and points layer over it, and a scatter of conversion rates binds to a named right-hand axis:

Start Building Now!

Representation Does Not Change the Mark

Large marks can be transported as decimated lines or density summaries. That changes the screen representation, not the declarative mark or the canonical Python columns. Exact row callbacks require a live notebook or framework transport; a standalone export can only inspect its resident representation.

See Large data and performance for the tiering contract and Marks and components reference for signatures and defaults.

API Reference

xy.line

A line series with automatic M4 decimation for large inputs.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Line color.

widthfloat

Line width in pixels.

opacityfloat

Line opacity from zero to one.

curvestr

Interpolation mode, such as ``linear`` or ``smooth``.

dashUnion[str, Sequence[float], None]

Optional line dash pattern.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.scatter

A scatter series with optional color, size, and density encodings.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

colorUnion[str, ColorLike, ArrayLike, None]

Constant color, values, or a column name.

sizeUnion[str, Scalar, ArrayLike, None]

Constant marker size, values, or a column name.

nameOptional[str]

Series label used by legends and tooltips.

colormapchannels.ColormapLike

Color ramp for continuous values — a built-in name, a CSS ``linear-gradient(...)``, or a sequence of CSS colors (optionally ``(position, color)`` pairs).

color_domainOptional[tuple[float, float]]

Explicit minimum and maximum for continuous colors.

size_rangetuple[float, float]

Minimum and maximum rendered marker sizes.

opacityAny

Marker opacity from zero to one.

zoom_size_factorfloat

Marker-size multiplier reached on deep zoom.

zoom_opacityOptional[float]

Optional marker opacity reached on deep zoom.

zoom_emphasisfloat

Zoom factor at which responsive targets are reached.

densityOptional[bool]

Whether to force or disable density aggregation.

symbolAny

Marker symbol name.

strokeAny

Optional marker outline color.

stroke_widthAny

Marker outline width in pixels.

_artist_alphaAny

Internal Matplotlib alpha override, scalar or per marker.

_marker_pathOptional[dict[str, Any]]

Internal authored marker-path payload for Matplotlib adapters.

_marker_glyphOptional[str]

Internal single-glyph marker payload for Matplotlib adapters.

_legend_trace_sizebool

Whether a Matplotlib legend derives marker size from this trace.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.area

A filled area series between ``y`` and ``base``.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

baseUnion[str, Scalar, ArrayLike]

Baseline value, values, or a column name.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Area fill color.

opacityfloat

Fill opacity from zero to one.

line_colorOptional[str]

Outline color.

line_widthfloat

Outline width in pixels.

line_opacityfloat

Outline opacity from zero to one.

stroke_perimeterbool

Whether to stroke the complete area perimeter.

fillUnion[str, dict[str, str], None]

CSS fill value or linear gradient.

curvestr

Interpolation mode, such as ``linear`` or ``smooth``.

dashUnion[str, Sequence[float], None]

Optional outline dash pattern.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.bar

A bar series supporting grouped, stacked, and normalized modes.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

Category positions or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Bar values, series matrix, or a column name.

dataTableLike

Table used to resolve column-name inputs.

nameOptional[str]

Series label used by legends and tooltips.

colorAny

Constant color, values, or a column name.

colorsOptional[list[str]]

Colors assigned to multiple series.

widthUnion[Scalar, ArrayLike]

Scalar or per-bar widths in category units.

baseUnion[str, Scalar, ArrayLike]

Baseline value, values, or a column name.

modestr

``grouped``, ``stacked``, or ``normalized`` layout.

orientationstr

``vertical`` or ``horizontal`` orientation.

seriesOptional[list[str]]

Optional names for matrix-valued series.

opacityAny

Bar opacity from zero to one.

corner_radiusAny

Bar corner radius in pixels.

wedge_gapfloat

Gap between neighbouring polar wedges, in pixels — constant from the hole to the rim. Deliberately a length, not an angle: an angular pad's gap is ``r · dtheta`` wide and so tapers to nothing toward the centre. Ignored outside ``coords="polar"``.

strokeAny

Optional bar outline color.

stroke_widthAny

Bar outline width in pixels.

_artist_alphaAny

Internal Matplotlib alpha override, scalar or per bar.

fillUnion[str, dict[str, str], None]

CSS fill value or linear gradient.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.column

Create a vertical column series using the shared bar renderer.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

Category positions or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Column values, series matrix, or a column name.

dataTableLike

Table used to resolve column-name inputs.

nameOptional[str]

Series label used by legends and tooltips.

colorUnion[str, Sequence[str], None]

Constant color, values, or a column name.

colorsOptional[list[str]]

Colors assigned to multiple series.

widthUnion[Scalar, ArrayLike]

Scalar or per-column widths in category units.

baseUnion[str, Scalar, ArrayLike]

Baseline value, values, or a column name.

modestr

``grouped``, ``stacked``, or ``normalized`` layout.

orientationstr

Orientation forwarded to the bar renderer.

seriesOptional[list[str]]

Optional names for matrix-valued series.

opacityfloat

Column opacity from zero to one.

corner_radiusUnion[float, tuple[float, float]]

Column corner radius in pixels.

wedge_gapfloat

Gap between neighbouring polar wedges, in pixels — constant from the hole to the rim. Deliberately a length, not an angle: an angular pad's gap is ``r · dtheta`` wide and so tapers to nothing toward the centre. Ignored outside ``coords="polar"``.

strokeOptional[str]

Optional column outline color.

stroke_widthfloat

Column outline width in pixels.

fillUnion[str, dict[str, str], None]

CSS fill value or linear gradient.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.histogram

A one-dimensional histogram.

Props

PropTypeDescription
valuesUnion[str, ArrayLike, None]

Sample values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

binsUnion[int, str, ArrayLike]

Bin count, edges, or automatic binning strategy.

rangeOptional[tuple[float, float]]

Explicit minimum and maximum input values.

densitybool

Whether to normalize bin areas to one.

cumulativebool

Whether bins contain cumulative counts.

nameOptional[str]

Series label used by legends and tooltips.

colorAny

Bar color.

opacityAny

Bar opacity from zero to one.

corner_radiusAny

Bar corner radius in pixels.

strokeAny

Optional bar outline color.

stroke_widthAny

Bar outline width in pixels.

_artist_alphaAny

Internal Matplotlib alpha override, scalar or per bin.

fillUnion[str, dict[str, str], None]

CSS fill value or linear gradient.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.box

Grouped Tukey box plots from 1-D or column-oriented 2-D values.

Props

PropTypeDescription
valuesUnion[str, ArrayLike, None]

Sample values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

xUnion[str, ArrayLike, None]

Optional group positions or a column name.

groupUnion[str, ArrayLike, None]

Optional grouping values or a column name.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Box color.

widthfloat

Box width in category units.

opacityfloat

Box opacity from zero to one.

orientationstr

``vertical`` or ``horizontal`` orientation.

show_outliersbool

Whether to render outlier points.

outlier_sizefloat

Outlier marker size in pixels.

styleOptional[dict[str, StyleValue]]

Box-body fill, border, and overall opacity overrides.

whisker_styleOptional[dict[str, StyleValue]]

Whisker stroke overrides.

median_styleOptional[dict[str, StyleValue]]

Median-line stroke overrides.

outlier_styleOptional[dict[str, StyleValue]]

Outlier marker fill, border, shape, and opacity overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.violin

Grouped bounded-resolution violin distributions.

Props

PropTypeDescription
valuesUnion[str, ArrayLike, None]

Sample values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

xUnion[str, ArrayLike, None]

Optional group positions or a column name.

groupUnion[str, ArrayLike, None]

Optional grouping values or a column name.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Violin color.

widthfloat

Violin width in category units.

binsint

Density resolution.

opacityfloat

Violin opacity from zero to one.

orientationstr

``vertical`` or ``horizontal`` orientation.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.ecdf

An empirical cumulative distribution function.

Props

PropTypeDescription
valuesUnion[str, ArrayLike, None]

Sample values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

binsOptional[int]

Optional bounded number of evaluation bins.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Line color.

widthfloat

Line width in pixels.

opacityfloat

Line opacity from zero to one.

dashUnion[str, Sequence[float], None]

Optional line dash pattern.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.heatmap

A rectangular heatmap from a two-dimensional matrix.

Props

PropTypeDescription
zUnion[str, ArrayLike, None]

Two-dimensional values or a column name resolved from ``data``.

xUnion[str, ArrayLike, None]

Optional x coordinates or a column name.

yUnion[str, ArrayLike, None]

Optional y coordinates or a column name.

dataTableLike

Table used to resolve column-name inputs.

nameOptional[str]

Series label used by legends and tooltips.

colormapchannels.ColormapLike

Colormap used for cell values.

domainOptional[tuple[float, float]]

Explicit minimum and maximum for the color scale.

opacityfloat

Cell opacity from zero to one.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.hexbin

A native-kernel binned hexagonal density plot.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

gridsizeint | tuple[int, int]

Horizontal and optional vertical bin counts.

rangeOptional[tuple[tuple[float, float], tuple[float, float]]]

Explicit x and y input ranges.

binsstr

Bin normalization mode.

CUnion[str, ArrayLike, None]

Optional values aggregated within each hexagon.

reduce_C_functionCallable[[np.ndarray], Scalar]

Reduction applied to values in each hexagon.

mincntOptional[int]

Minimum observations required to render a hexagon.

nameOptional[str]

Series label used by legends and tooltips.

colormapchannels.ColormapLike

Colormap used for bin values.

opacityfloat

Hexagon opacity from zero to one.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.contour

Regular-grid isolines, optionally with a filled density surface.

Props

PropTypeDescription
zUnion[str, ArrayLike, None]

Two-dimensional scalar grid or a column name.

xUnion[str, ArrayLike, None]

Optional x coordinates or a column name.

yUnion[str, ArrayLike, None]

Optional y coordinates or a column name.

dataTableLike

Table used to resolve column-name inputs.

levelsUnion[int, ArrayLike]

Number or explicit values of contour levels.

filledbool

Whether to fill intervals between contours.

nameOptional[str]

Series label used by legends and tooltips.

colormapchannels.ColormapLike

Colormap used for contour values.

colorAny

Constant isoline color or direct RGBA colors cycled by level.

widthAny

Isoline width in pixels, scalar or cycled by contour level.

opacityfloat

Contour opacity from zero to one.

dash_negativebool

Whether negative isolines use a dashed stroke.

extendstr

Whether filled contours paint values below or above the levels.

corner_maskbool

Preserve the valid triangle of a quad with one missing corner.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.errorbar

Vertical and/or horizontal uncertainty bars.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

yerrUnion[str, Scalar, ArrayLike, None]

Symmetric or asymmetric vertical error values.

xerrUnion[str, Scalar, ArrayLike, None]

Symmetric or asymmetric horizontal error values.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Error-bar color.

widthfloat

Stroke width in pixels.

cap_sizeOptional[float]

Optional cap length in pixels.

opacityfloat

Stroke opacity from zero to one.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.error_band

A confidence or error band between lower and upper series.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

lowerUnion[str, ArrayLike, None]

Lower-bound values or a column name.

upperUnion[str, ArrayLike, None]

Upper-bound values or a column name.

dataTableLike

Table used to resolve column-name inputs.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Band color.

opacityfloat

Band opacity from zero to one.

line_widthfloat

Boundary-line width in pixels.

line_opacityfloat

Boundary-line opacity from zero to one.

fillUnion[str, dict[str, str], None]

CSS fill value or linear gradient.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

keyAny

Stable row identities, or a column name resolved from ``data``.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.step

A stepped line series.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

wherestr

Position of each step transition.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Line color.

widthfloat

Line width in pixels.

opacityfloat

Line opacity from zero to one.

dashUnion[str, Sequence[float], None]

Optional line dash pattern.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.stairs

A precomputed stairs series from values and bin edges.

Props

PropTypeDescription
valuesUnion[str, ArrayLike, None]

Step heights or a column name resolved from ``data``.

edgesUnion[str, ArrayLike, None]

Bin-edge values or a column name.

dataTableLike

Table used to resolve column-name inputs.

wherestr

Position of each step transition.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Line color.

widthfloat

Line width in pixels.

opacityfloat

Line opacity from zero to one.

dashUnion[str, Sequence[float], None]

Optional line dash pattern.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.stem

A stem plot with optional point markers.

Props

PropTypeDescription
xUnion[str, ArrayLike, None]

X values or a column name resolved from ``data``.

yUnion[str, ArrayLike, None]

Y values or a column name resolved from ``data``.

dataTableLike

Table used to resolve column-name inputs.

baseUnion[str, Scalar, ArrayLike]

Baseline value, values, or a column name.

nameOptional[str]

Series label used by legends and tooltips.

colorOptional[str]

Stem and marker color.

widthfloat

Stem width in pixels.

opacityfloat

Mark opacity from zero to one.

markerbool

Whether to draw a marker at each stem endpoint.

marker_sizefloat

Marker size in pixels.

symbolstr

Marker symbol name.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.segments

Independent line segments rendered as one instanced mark.

Props

PropTypeDescription
x0Union[str, ArrayLike, None]

Starting x coordinates or a column name.

y0Union[str, ArrayLike, None]

Starting y coordinates or a column name.

x1Union[str, ArrayLike, None]

Ending x coordinates or a column name.

y1Union[str, ArrayLike, None]

Ending y coordinates or a column name.

dataTableLike

Table used to resolve column-name inputs.

nameOptional[str]

Series label used by legends and tooltips.

colorUnion[str, ColorLike, ArrayLike, None]

Constant color, values, or a column name.

colormapchannels.ColormapLike

Color ramp for continuous values — a built-in name, a CSS ``linear-gradient(...)``, or a sequence of CSS colors (optionally ``(position, color)`` pairs).

domainOptional[tuple[float, float]]

Explicit minimum and maximum for continuous colors.

widthAny

Segment width in pixels.

opacityAny

Segment opacity from zero to one.

dashUnion[str, Sequence[float], None]

Optional line dash pattern.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.ribbon

Flow bands: a vertical span at `x0` joined to one at `x1` by a cubic.

Props

PropTypeDescription
x0Union[str, ArrayLike, None]

Source face x coordinates or a column name.

x1Union[str, ArrayLike, None]

Target face x coordinates or a column name.

source_loUnion[str, ArrayLike, None]

Lower edge of the span at `x0`.

source_hiUnion[str, ArrayLike, None]

Upper edge of the span at `x0`.

target_loUnion[str, ArrayLike, None]

Lower edge of the span at `x1`.

target_hiUnion[str, ArrayLike, None]

Upper edge of the span at `x1`.

dataTableLike

Table used to resolve column-name inputs.

colorUnion[str, ColorLike, ArrayLike, None]

Source-end colour(s).

color_targetUnion[str, ColorLike, ArrayLike, None]

Target-end colour(s); omit for a flat band.

colormapchannels.ColormapLike

Ramp for continuous colour values.

nameOptional[str]

Series label used by legends and tooltips.

opacityAny

Band fill opacity from zero to one.

strokeAny

Optional band outline colour.

stroke_widthAny

Band outline width in pixels.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

xy.sankey

A Sankey flow diagram from ``(source, target, value)`` links.

Props

PropTypeDescription
linksAny

``(source, target, value)`` triples; endpoints are node names.

nodesOptional[Sequence[Any]]

Explicit node order. Defaults to first appearance in `links`.

node_widthfloat

Node rectangle width as a fraction of the diagram.

node_paddingfloat

Vertical gap between nodes in a layer, as a fraction.

alignstr

``"justify"`` (default) flushes sinks to the last layer.

iterationsint

Crossing-minimisation sweeps.

colorsOptional[Sequence[str]]

One CSS colour per node, in node order.

link_opacityAny

Ribbon opacity; node rectangles stay opaque.

labelsbool

Draw node names beside the nodes.

label_sizefloat

Node label font size in px.

styleOptional[dict[str, StyleValue]]

Style overrides for the link ribbons.

xy.funnel

A funnel mark: one centered segment per stage, in declared order.

Props

PropTypeDescription
stageUnion[str, ArrayLike, None]

Stage names in order, or a column name resolved from ``data``.

valueUnion[str, ArrayLike, None]

One non-negative value per stage, or a column name.

dataTableLike

Table used to resolve column-name inputs.

keyAny

Stable per-stage identities for animation matching, or a column name. Defaults to positional matching.

orientationstr

``"vertical"`` stacks stages along y (stage 0 on top in `funnel_chart`); ``"horizontal"`` runs them along x.

geometrystr

``"area"`` draws the classic tapering silhouette (each segment's far edge previews the next stage, so painted area is NOT proportional to the value); ``"bar"`` draws centered constant-width segments whose widths carry the values exactly.

gapOptional[float]

Gap between segments as a fraction of the stage pitch, in ``[0, 1)``. ``None`` resolves per geometry: 0 for ``"area"`` (a continuous silhouette), 0.2 for ``"bar"`` (bar-chart spacing).

neckstr

Last area segment's far edge: ``"rect"`` holds the stage's own width, ``"taper"`` runs it to a point. Area geometry only.

min_widthfloat

Drawn-width floor as a fraction of the widest stage, in ``[0, 1]``. Keeps zero/tiny stages visible and hoverable; values in labels, tooltips and events are never clamped.

colorOptional[str]

One constant CSS color for every segment (no per-stage legend).

colorsOptional[Sequence[str]]

One CSS color per stage. Defaults to the palette cycle in declared stage order.

nameOptional[str]

Series label. Legend rows normally come from the per-stage categorical encoding instead.

opacityAny

Segment opacity from zero to one (per-trace).

strokeAny

Optional segment outline color (per-trace).

stroke_widthAny

Segment outline width in pixels (per-trace).

show_valuesbool

Draw the value label on each segment.

show_conversionbool

Append the overall conversion (share of the first stage) to each value label.

show_dropoffbool

Draw the signed stage-over-stage change at each boundary (``-38%`` for a drop, ``+12%`` for growth).

labelsbool

Master switch for all funnel labels.

label_sizefloat

Label font size in px.

value_formatstr

``str.format`` template for values.

percent_formatstr

``str.format`` template for ratios.

animationAnimation | bool | None

Per-mark animation override; ``False`` disables animation.

styleOptional[dict[str, StyleValue]]

Mark style overrides (opacity, stroke, stroke-width).

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

xy.triangle_mesh

Filled triangle mesh with constant or per-triangle color values.

Props

PropTypeDescription
x0Union[str, ArrayLike, None]

First-vertex x coordinates or a column name.

y0Union[str, ArrayLike, None]

First-vertex y coordinates or a column name.

x1Union[str, ArrayLike, None]

Second-vertex x coordinates or a column name.

y1Union[str, ArrayLike, None]

Second-vertex y coordinates or a column name.

x2Union[str, ArrayLike, None]

Third-vertex x coordinates or a column name.

y2Union[str, ArrayLike, None]

Third-vertex y coordinates or a column name.

dataTableLike

Table used to resolve column-name inputs.

colorUnion[str, ColorLike, ArrayLike, None]

Constant color, values, or a column name.

colormapchannels.ColormapLike

Color ramp for continuous values — a built-in name, a CSS ``linear-gradient(...)``, or a sequence of CSS colors (optionally ``(position, color)`` pairs).

domainOptional[tuple[float, float]]

Explicit minimum and maximum for continuous colors.

nameOptional[str]

Series label used by legends and tooltips.

opacityAny

Triangle opacity from zero to one.

strokeAny

Optional triangle outline color.

stroke_widthAny

Triangle outline width in pixels.

_joined_fillbool

Internal pyplot hint for suppressing shared triangle edges.

styleOptional[dict[str, StyleValue]]

Mark style overrides.

class_nameOptional[str]

Adapter-only trace metadata; it does not style canvas geometry.

x_axisstr

Identifier of the x axis used by this mark.

y_axisstr

Identifier of the y axis used by this mark.

FAQ

How do I combine multiple marks in one chart in Python?

Pass several mark factories as children of one chart container, e.g. xy.line_chart(xy.area(...), xy.line(...), xy.scatter(...)). Give each mark a name= for the legend, and pass data= once on the chart to share a table across marks (a mark-level data= overrides it).

How do I control which mark draws on top of another?

Marks render in declaration order: later children paint over earlier ones. Put broad fills such as xy.area() first and overlays such as xy.line() or xy.scatter() after them.

How do I style each series differently in one chart?

Every mark takes its own paint options — for example xy.line(..., color=...) or a style= dict of CSS declarations compiled for WebGL, SVG, and native raster output. CSS selectors, Tailwind classes, and class_name= cannot paint canvas or WebGL geometry, so per-series styling always goes through the mark itself.

Can I plot a mark against a second y-axis?

Yes — bind the mark with y_axis="y2" (or x_axis= for x) and add a matching xy.y_axis(id="y2", side="right") component to the chart. X-axis identifiers must start with x and y-axis identifiers with y, and every named binding needs a matching axis component.

Built with Reflex