Skip to content
Examples

Examples

Every example below comes straight from its chart function’s own Example: docstring section in this repo’s dataviz/ source – each page shows the actual grammar-of-graphics pattern next to its actual rendered output, so you can see exactly what it takes to produce that chart.

Most reach for a single one-call convenience function – bar(categories, values), scatter(x, y), and so on, one per mark, imported straight from dataviz – built on top of the fuller Plot builder (.encode()/.theme()/.labels(), then render()) that the rest still use directly, for whatever these don’t cover yet.

Not sure how to arrange an input? See Data shapes for columns, nested lists, matrices, edges, and hierarchies.

For behavior shared across chart types, see the Guides. The Glossary defines chart terminology.

Basic

The core chart types – one mark, default theme. Line’s page also shows its step and time-axis forms, area’s its stepped form, and pie’s its donut ring.

Categorical

Chart types built around one categorical dimension: rankings, timelines, progress, period-over-period comparisons, process stages, and OHLC price data per period.

Distributions

The shape of one or two numeric variables: binned counts, summaries of spread, density estimates, and event times. Histogram’s page also shows shared bins, automatic bins, a density curve, and the horizontal form.

Estimates & compositions

Charts that summarize or combine other charts: a bar, line, or point per group with an aggregate and its error, the residuals of a fit, and figures assembled from several panels.

Grid & matrix

A value per cell of a grid. Mostly two categorical dimensions; imshow and pcolormesh are the continuous-axis pair, for an array rather than a table.

Relationships & flows

Weighted connections between entities, not a value per category.

Hierarchical

A tree, not a value per category – one flattened id/parent_id/value row per node (see Plot.encode_hierarchy()), or a clustering’s merge tree.

Radial & polar

Chart types built on a polar (angle + radius) coordinate system instead of a cartesian one.

Fields & multivariate

Several numeric dimensions on one shared layout, or a value defined over a plane: vector fields, contours, and triangulated meshes.

Three dimensions

A third axis projected onto the page. Orthographic, so parallel stays parallel and a tick spacing means one thing across the whole picture – but a single view still collapses three dimensions onto two, and two points that look adjacent may be far apart along the view direction. Where the question is about two variables, the 2D charts above answer it better.