ggplot2 4.0.0 changed how geoms get their default aesthetics: many defaults are now looked up from the plot theme. This change broke some older plots of mine that relied on the previous hard-coded defaults. When finalizing plots, I would tweak point size by adjusting plot dimensions (small plot -> bigger apparent points), but theme_grey(base_size) will change the size of points and not just text. Thus, a lot of my old plots looked wrong. I think it was an undocumented breaking change in the package, and to their credit, the ggplot2 authors retroactively updated the news into mention this change.1

Anyway, to recover the old behavior (or at least inspect it), I pulled the default_aes from each geom in ggplot2 3.5.2. This output gives me a snapshot of the old aesthetics, so I can quickly drop in some point aesthetics for quick fixes of those plots.

withr::local_temp_libpaths()
pak::pkg_install("ggplot2@3.5.2")
#> ℹ Loading metadata database✔ Loading metadata database ... done
#>  
#> → Will install 20 packages.
#> → Will download 14 CRAN packages (8.03 MB), cached: 6 (4.94 MB).
#> + cli            3.6.6  
#> + farver         2.1.2  [dl] (1.52 MB)
#> + ggplot2        3.5.2  [bld]
#> + glue           1.8.1  
#> + gtable         0.3.6  [dl] (249.67 kB)
#> + isoband        0.3.0  [dl] (1.98 MB)
#> + labeling       0.4.3  [dl] (63.42 kB)
#> + lifecycle      1.0.5  [dl] (149.81 kB)
#> + magrittr       2.0.5  
#> + pillar         1.11.1 [dl] (673.34 kB)
#> + pkgconfig      2.0.3  [dl] (22.81 kB)
#> + R6             2.6.1  [dl] (88.59 kB)
#> + RColorBrewer   1.1-3  [dl] (54.48 kB)
#> + rlang          1.2.0  
#> + scales         1.4.0  [dl] (877.87 kB)
#> + tibble         3.3.1  [dl] (667.34 kB)
#> + utf8           1.2.6  [dl] (155.23 kB)
#> + vctrs          0.7.3  
#> + viridisLite    0.4.3  [dl] (1.30 MB)
#> + withr          3.0.2  [dl] (231.63 kB)
#> ℹ Getting 14 pkgs (8.03 MB), 6 (4.94 MB) cached
#> ✔ Cached copy of R6 2.6.1 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of RColorBrewer 1.1-3 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of farver 2.1.2 (x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of gtable 0.3.6 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of isoband 0.3.0 (x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of labeling 0.4.3 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of lifecycle 1.0.5 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of pillar 1.11.1 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of pkgconfig 2.0.3 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of scales 1.4.0 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of tibble 3.3.1 (x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of utf8 1.2.6 (x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of viridisLite 0.4.3 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Cached copy of withr 3.0.2 (i386+x86_64-w64-mingw32) is the latest build
#> ✔ Installed ggplot2 3.5.2  (533ms)
#> ✔ Installed R6 2.6.1  (622ms)
#> ✔ Installed RColorBrewer 1.1-3  (658ms)
#> ✔ Installed labeling 0.4.3  (607ms)
#> ✔ Installed glue 1.8.1  (772ms)
#> ✔ Installed farver 2.1.2  (925ms)
#> ✔ Installed isoband 0.3.0  (1s)
#> ✔ Installed gtable 0.3.6  (1.1s)
#> ✔ Installed cli 3.6.6  (1.3s)
#> ✔ Installed magrittr 2.0.5  (1.2s)
#> ✔ Installed lifecycle 1.0.5  (1.3s)
#> ✔ Installed pillar 1.11.1  (1.3s)
#> ✔ Installed pkgconfig 2.0.3  (898ms)
#> ✔ Installed rlang 1.2.0  (887ms)
#> ✔ Installed scales 1.4.0  (985ms)
#> ✔ Installed tibble 3.3.1  (944ms)
#> ✔ Installed utf8 1.2.6  (878ms)
#> ✔ Installed viridisLite 0.4.3  (799ms)
#> ✔ Installed vctrs 0.7.3  (1s)
#> ✔ Installed withr 3.0.2  (774ms)
#> ✔ 1 pkg + 24 deps: kept 1, added 20 [12.2s]

self_name <- function(x) stats::setNames(x, x)

asNamespace("ggplot2") |> 
  ls(pattern = "Geom.") |> 
  self_name() |> 
  lapply(get, envir = asNamespace("ggplot2")) |> 
  lapply(function(obj) obj$default_aes) |> 
  # make sure every result has the aes nice printing method
  lapply(function(x) { 
    class(x) <- "uneval"
    x
  })
#> $GeomAbline
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomAnnotationMap
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `subgroup`  -> NULL
#> 
#> $GeomArea
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomBar
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey35"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomBlank
#> Aesthetic mapping: 
#> <empty>
#> 
#> $GeomBoxplot
#> Aesthetic mapping: 
#> * `weight`    -> 1
#> * `colour`    -> "grey20"
#> * `fill`      -> "white"
#> * `size`      -> NULL
#> * `alpha`     -> NA
#> * `shape`     -> 19
#> * `linetype`  -> "solid"
#> * `linewidth` -> 0.5
#> 
#> $GeomCol
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey35"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomContour
#> Aesthetic mapping: 
#> * `weight`    -> 1
#> * `colour`    -> "#3366FF"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomContourFilled
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `subgroup`  -> NULL
#> 
#> $GeomCrossbar
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `fill`      -> NA
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomCurve
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomCustomAnn
#> Aesthetic mapping: 
#> * `xmin` -> -Inf
#> * `xmax` -> Inf
#> * `ymin` -> -Inf
#> * `ymax` -> Inf
#> 
#> $GeomDensity
#> Aesthetic mapping: 
#> * `fill`      -> NA
#> * `weight`    -> 1
#> * `colour`    -> "black"
#> * `alpha`     -> NA
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> 
#> $GeomDensity2d
#> Aesthetic mapping: 
#> * `colour`    -> "#3366FF"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomDensity2dFilled
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `subgroup`  -> NULL
#> 
#> $GeomDotplot
#> Aesthetic mapping: 
#> * `colour`   -> "black"
#> * `fill`     -> "black"
#> * `alpha`    -> NA
#> * `stroke`   -> 1
#> * `linetype` -> "solid"
#> * `weight`   -> 1
#> 
#> $GeomErrorbar
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `width`     -> 0.5
#> * `alpha`     -> NA
#> 
#> $GeomErrorbarh
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `height`    -> 0.5
#> * `alpha`     -> NA
#> 
#> $GeomFunction
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomHex
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey50"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomHline
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomLabel
#> Aesthetic mapping: 
#> * `colour`     -> "black"
#> * `fill`       -> "white"
#> * `size`       -> 3.88
#> * `angle`      -> 0
#> * `hjust`      -> 0.5
#> * `vjust`      -> 0.5
#> * `alpha`      -> NA
#> * `family`     -> ""
#> * `fontface`   -> 1
#> * `lineheight` -> 1.2
#> 
#> $GeomLine
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomLinerange
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomLogticks
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> 1
#> 
#> $GeomMap
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `subgroup`  -> NULL
#> 
#> $GeomPath
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomPoint
#> Aesthetic mapping: 
#> * `shape`  -> 19
#> * `colour` -> "black"
#> * `size`   -> 1.5
#> * `fill`   -> NA
#> * `alpha`  -> NA
#> * `stroke` -> 0.5
#> 
#> $GeomPointrange
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `size`      -> 0.5
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `shape`     -> 19
#> * `fill`      -> NA
#> * `alpha`     -> NA
#> * `stroke`    -> 1
#> 
#> $GeomPolygon
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `subgroup`  -> NULL
#> 
#> $GeomQuantile
#> Aesthetic mapping: 
#> * `weight`    -> 1
#> * `colour`    -> "#3366FF"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomRaster
#> Aesthetic mapping: 
#> * `fill`  -> "grey20"
#> * `alpha` -> NA
#> 
#> $GeomRasterAnn
#> Aesthetic mapping: 
#> <empty>
#> 
#> $GeomRect
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey35"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomRibbon
#> Aesthetic mapping: 
#> * `colour`    -> NA
#> * `fill`      -> "grey20"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomRug
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomSegment
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomSf
#> Aesthetic mapping: 
#> * `shape`     -> NULL
#> * `colour`    -> NULL
#> * `fill`      -> NULL
#> * `size`      -> NULL
#> * `linewidth` -> NULL
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `stroke`    -> 0.5
#> 
#> $GeomSmooth
#> Aesthetic mapping: 
#> * `colour`    -> "#3366FF"
#> * `fill`      -> "grey60"
#> * `linewidth` -> 1
#> * `linetype`  -> 1
#> * `weight`    -> 1
#> * `alpha`     -> 0.4
#> 
#> $GeomSpoke
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomStep
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> 
#> $GeomText
#> Aesthetic mapping: 
#> * `colour`     -> "black"
#> * `size`       -> 3.88
#> * `angle`      -> 0
#> * `hjust`      -> 0.5
#> * `vjust`      -> 0.5
#> * `alpha`      -> NA
#> * `family`     -> ""
#> * `fontface`   -> 1
#> * `lineheight` -> 1.2
#> 
#> $GeomTile
#> Aesthetic mapping: 
#> * `fill`      -> "grey20"
#> * `colour`    -> NA
#> * `linewidth` -> 0.1
#> * `linetype`  -> 1
#> * `alpha`     -> NA
#> * `width`     -> NA
#> * `height`    -> NA
#> 
#> $GeomViolin
#> Aesthetic mapping: 
#> * `weight`    -> 1
#> * `colour`    -> "grey20"
#> * `fill`      -> "white"
#> * `linewidth` -> 0.5
#> * `alpha`     -> NA
#> * `linetype`  -> "solid"
#> 
#> $GeomVline
#> Aesthetic mapping: 
#> * `colour`    -> "black"
#> * `linewidth` -> 0.5
#> * `linetype`  -> 1
#> * `alpha`     -> NA
  1. I hope I don’t seem like a crank by mentioning these bugbears and GitHub issues in these notes. 

Leave a comment