Pavement Plots: Quantile Visualization Where Denser Data = Denser Lines

heterodoxjedi1 pts0 comments

Pavement plots

Skip to content

Initializing search

ajschumacher/pavement

User Guide

Examples

API Reference

Pavement plots

A pavement plot visualizes univariate data as boxes stretching from<br>min to max, each holding an equal share of the data. Where the data<br>is denser, lines are denser, making visual interpretation intuitive.<br>It's a quantile plot you can take in at a glance: a cousin of box<br>plots and rug plots, with no assumption of central tendency, and<br>better suited to large data sets.

Four classic shapes, each as a 16-bin pavement. The tight cluster of lines is<br>where the data piles up; the wide boxes are the sparse tails — two humps for<br>the bimodal set, a heavy peak for the leptokurtic one, a long tail for the<br>skewed one.

One API, many canvases. Pick a backend by importing its submodule:

Static images<br>matplotlib — also supports marginal strips and 2D pavements

Interactive visualizations, with hover info built in<br>Bokeh , Plotly , HoloViews (including marginal helpers)

pavement.svg — dependency-free inline sparklines for the web

import pavement.matplotlib as pavement # or .bokeh / .plotly / .holoviews<br>pavement.plot([1, 2, 3, 4, 5])

import pavement.svg # sparklines for HTML: svg has spark, not plot<br>pavement.svg.spark([1, 2, 3, 4, 5]) # an ... string

Glance at a whole dataframe&para;

pavement.summary(df) turns a pandas or polars dataframe (or Series,<br>or plain sequence) into an inline table. Each variable is shown with a<br>tally plot (how much is distinct / duplicate / missing) and a<br>distribution plot that adapts to the column: a pavement spark for<br>numbers, dates, and durations, and a proportion strip for<br>categories. It needs no plotting dependency and renders inline in a<br>notebook; in a browser its rows are drag-to-reorder by default — the<br>one sprinkle of JavaScript, which stays out of notebooks and static<br>exports (and is off with draggable=False).

import pavement<br>pavement.summary(df) # renders inline in a Jupyter cell

Every column kind at once: an all-distinct id, a category (plan), a discrete<br>rating drawn as a frequency rug, a continuous age, a date on a time axis, a<br>duration, a long-tailed purchases, and an almost-all-missing legacy_field.<br>The top row summarizes the frame itself.

See examples/ for lots more, including<br>svg_demo.py (inline sparklines),<br>interactive_demo.py (Plotly, Bokeh, HoloViews),<br>pandas_polars_demo.py (the .pave accessor),<br>and real_data.ipynb (singer heights, US income).

User Guide

Every backend, the shared plot API, rugs, marginals, sparklines, and<br>dataframe summaries — walked through end to end.

Read the guide

Examples

Live, interactive outputs — Plotly, Bokeh, inline SVG sparklines, and<br>whole-dataframe summaries — straight from the examples/ scripts.

Browse examples

API Reference

Auto-generated from the docstrings: the backend-agnostic statistics and<br>every backend's plot, spark, and helpers.

API reference

Install

pip install pavement

Pure-Python core, zero required dependencies. Add a backend with<br>pip install pavement[plotly] (or matplotlib, bokeh, holoviews).

On PyPI

Back to top

pavement plot data inline plots examples

Related Articles