Cracking open ggplot internals with {ggtrace}
summary
Package ggtrace exposes ggplot2’s pipeline as four inspectable states and provides functions to snapshot and mutate the data between stat and geom so users can reason about hidden transformations. It demonstrates ggtrace_inspect_args() and ggtrace_inspect_return() on a Penguins bar plot and a boxplot where the goal is to label the second box’s upper whisker. Solution uses stage() to preserve y for the stat then remap y after_stat(ymax) so the geom_label draws the computed value; code and materials live on GitHub.
AI-written summary · about
chapters (9)
- 0:00Start
- 4:07ggplot internals as data wrangling
- 4:55Layers as dataframes
- 10:21Walkthrough with a barplot
- 12:26After Stat
- 13:19Before Geom
- 17:31Multiple mappings with stage()
- 17:57ggplot internals for users
- 18:40Capture workflow
related talks
19mCracking open ggplot internals with {ggtrace}
01h 01m50 ways to show your data
23mBest practices for programming with ggplot2
34mVisualising Multi Dimensional Data
19mgganimate live cookbook
30mFrom plotting to chart porn - Creating slick charts with Matplotlib
18mBe Kind, Rewind
01h 26mTurning DataFrames into Pretty Pictures with Plotnine
