← Back to all sparks
P

patchwork

ANALYTICS
Velocity0.0

Compose multiple ggplot2 plots into a single figure with simple arithmetic operators

patchwork stopped being a ggplot composer and became a page composer.

ggplot2compositiontableslayouttidyversemaintenance
Current state
patchwork assembles plots into compositions with arithmetic operators, and the 1.x line has steadily hardened that grammar: guide and axis collection, free() to exempt a plot from alignment, inset_element() for overlays, and list-like behaviour so lapply() and length() work on a patchwork. Version 1.3.0 added native gt table support. The two releases since are a load-time warning fix and a compatibility pass for the next ggplot2 release.
Where it's heading
The centre of gravity is shifting from alignment mechanics to composition scope. Early releases were almost entirely bug fixes against grid and ggplot2 internals — strip placement, fixed aspect ratios, guide merging. Recent ones add object types and escape hatches instead. Between feature cycles the package is in maintenance defined by ggplot2's release calendar, which is what 1.3.1 is in its entirety.
Prediction
Expect wrap_table() to grow beyond gt to other table objects, and expect the next substantive release to be triggered by a ggplot2 internals change rather than by a patchwork roadmap.

Recent moves

  1. 11mo ago

    Fix spurious load-time warnings

    A single load-time bug that produced spurious warnings. No change to composition behaviour.

    View source ↗
  2. 1y ago

    Compatibility pass for the next ggplot2 release

    A compatibility release for the next ggplot2 version, with no changes of its own. This is the maintenance pattern the package sits in between feature cycles — the release calendar belongs to ggplot2.

    View source ↗
  3. 1y ago

    gt tables become first-class patchwork objects

    ⚡ SPARK

    Native gt table support extends the composition grammar past ggplot objects for the first time, alongside nest(), as.list(), and a much more controllable free(). This is the release that changes what a patchwork can contain rather than how well it aligns.

    View source ↗
  4. 2y ago

    Axis collection and free() arrive

    Adds axis and axis-title collection in plot_layout(), removing and merging duplicates across a composition, and introduces free() to exempt a plot from alignment. Two of the most-requested layout controls, and the groundwork 1.3.0 builds on.

    View source ↗
  5. 3y ago

    Patchworks behave like lists; NULL becomes a no-op

    Makes patchwork objects behave like an unnamed list of plots so View() and length() work, allows NULL in the arithmetic operators as a no-op, and fixes serialisation into a fresh session. Mostly ergonomics, with a long tail of alignment bug fixes underneath.

    View source ↗
  6. 3y ago

    Clearer error when plotting space is too small

    A single improved error message for compositions that fail to render in too small a plotting space.

    View source ↗