Note
Go to the end to download the full example code.
Stairs

Live figure — pick a tool, then zoom, pan, point-pick or annotate. Nothing is active until a tool is selected.
View this figure’s Vega export ↗ — the raw JSON spec, rendered live by a real Vega engine.
View this figure’s Vega-Lite export ↗ — the raw JSON spec(s), rendered live by a real Vega-Lite engine.
import numpy as np
import plotpress
rng = np.random.default_rng(2)
values = rng.integers(1, 8, size=12)
edges = np.arange(values.size + 1) # len(values) + 1 bin edges
fig, ax = plotpress.subplots()
ax.stairs(values, edges, color="C0")
ax.set_title("stairs"); ax.set_xlabel("bin edge")
Total running time of the script: (0 minutes 0.066 seconds)