Gribouille - Grammar of Graphics

Gribouille (French for scribble) is a new Typst package that brings Wilkinson’s grammar of graphics natively into Typst, in the spirit of ggplot2 and plotnine .

Gribouille uses cetz as backend.

The first version was released the 20th of May 2026.

Repository: GitHub - mcanouil/gribouille: Create elegant graphics with the Grammar of Graphics for Typst. · GitHub
Documentation: Gribouille

#import "@preview/gribouille:0.3.0": *

#set page(width: 16cm, height: 10cm, margin: 0cm)

#plot(
  data: penguins,
  mapping: aes(
    x: "flipper-len",
    y: "body-mass",
    colour: "species",
    fill: "species",
  ),
  layers: (
    geom-point(size: 2pt, alpha: 0.65),
    geom-smooth(method: "lm", alpha: 0.2),
  ),
  facet: facet-wrap("island", labeller: label-both()),
  scales: (scale-y-continuous(labels: format-comma()),),
  labs: labs(
    title: "Penguin Morphology by Island",
    subtitle: "Flipper length versus body mass with a per-species linear fit",
    x: "Flipper Length (mm)",
    y: "Body Mass (g)",
    colour: "Species",
    fill: "Species",
  ),
  theme: theme-minimal(),
  guides: guides(
    colour: guide-legend(position: bottom + right),
    fill: guide-legend(position: bottom + right),
  ),
  width: auto,
  height: auto,
)

16 Likes

Find more “real” use cases at: TidyTuesday Gallery – TidyTuesday


9 Likes

Every line, star, and gradient in this chart was drawn in Typst, with Gribouille plotting its own star history.
Achieve publication-quality graphics with a single toolchain, no external plotting tools needed.

Gribouille 0.4.0 soon. Full source will ships with the announcement.

2 Likes

This is very, very cool. Thanks for sharing!

2 Likes

Gribouille 0.4.0 on its way to Typst Universe.

Read the full announcement and get the code for the figure: Gribouille 0.4.0: Temporal Scales, Any-Glyph Markers, and a Finer Grid – Mickaël CANOUIL

2 Likes

This is excellent package, with impressive attention to details ! :trophy:

2 Likes

Gribouille 0.5.0: Native Density, and Scales Keyed by Aesthetic

Release post: Gribouille 0.5.0: Native Density, and Scales Keyed by Aesthetic – Mickaël CANOUIL)

LinkedIn: Gribouille 0.5.0 | Mickaël CANOUIL

#import "@preview/gribouille:0.5.0": *

#let cb = (rgb("#0072B2"), rgb("#D55E00"), rgb("#009E73"))

#let stripes = tiling(size: (6pt, 6pt))[
  #place(rect(width: 100%, height: 100%, fill: cb.at(0).lighten(60%)))
  #place(line(start: (0%, 100%), end: (100%, 0%), stroke: 1pt + cb.at(0)))
]
#let dots = tiling(size: (7pt, 7pt))[
  #place(rect(width: 100%, height: 100%, fill: cb.at(1).lighten(60%)))
  #place(dx: 2pt, dy: 2pt, circle(radius: 1.5pt, fill: cb.at(1)))
]
#let cross = tiling(size: (7pt, 7pt))[
  #place(rect(width: 100%, height: 100%, fill: cb.at(2).lighten(60%)))
  #place(line(start: (0%, 100%), end: (100%, 0%), stroke: 0.8pt + cb.at(2)))
  #place(line(start: (0%, 0%), end: (100%, 100%), stroke: 0.8pt + cb.at(2)))
]

#plot(
  data: penguins,
  mapping: aes(x: "species", fill: "species"),
  layers: (geom-bar(),),
  scales: scales(fill: scale-manual(values: (stripes, dots, cross))),
  labels: labels(
    title: "Bars You Can Read in Greyscale",
    x: "Species",
    y: "Count",
    fill: "Species",
  ),
  theme: theme-minimal(),
  width: 12cm,
  height: 7cm,
)

4 Likes

Some more real examples with Gribouille:
A horizontal lollipop chart ranking eleven modern popes by the number of encyclicals they published, ordered from Leo XIII at the top down to Leo XIV, each pope labelled with their reign years and the count at the end of its stem. Leo XIII leads with 86 in a warm accent colour, more than double the next, Pius XII with 39. The remaining popes are in muted grey: Pius XI 23, Pius X 16, John Paul II 14, Benedict XV 12, John XXIII 8, Paul VI 7, Francis 4, Benedict XVI 3, and Leo XIV with 1. A translucent funnel links the Leo XIII point to an inset column chart in the bottom-right showing his encyclicals per year across his 25-year reign, holding roughly steady between two and eight.
A diverging bar chart styled as an underwater cross-section of Irish shipwrecks by decade from 1750 to 2010. A pale surface at the top deepens through blue into the dark deep at the bottom. A waterline at zero splits each decade into wrecks that have been located, rising above it in bright teal, and wrecks with no recorded position, sinking below it in steel blue. Before 1840 almost every column plunges into the deep, peaking in the 1850s with 1,382 lost, 96 percent never located. From the 1910s the found share climbs sharply: the vermillion-outlined World War One column is the turning point, with about half of that decade's wrecks found (630). After 1950 the small columns sit almost entirely above the waterline, nearly every wreck charted. A small sinking-ship motif rests in the deep bottom-right corner.

3 Likes

And two more from TidyTuesday Gallery – TidyTuesday


1 Like