Intro Thoughts
Status Quo
library(tidyverse)
Experiment
'gapminder::gapminder |>
filter(year == 2002) |>
ggplot() +
aes(x = gdpPercap/1000,
y = lifeExp) +
facet_wrap(vars(continent)) +
geom_point(
layout = "fixed", #<<
color = "grey"
) +
geom_point(aes(color = continent)) +
theme(legend.position = "none") +
annotate( #<<
"text",
x = I(.8), y = I(.2),
label = "🥳", #<<
layout = 5, #<<
size = 6
)' |>
ggram::ggram(code = _,
title = "🚨🥳 *Not only* can ggplot2 v4.0's 'layout' argument be used for shadow layers across facets,\nit *also* can be used to specify panel-specific annotations! ", widths = c(1.4,1.6))
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_tile()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_text()`).
## Warning: Removed 10 rows containing missing values or values outside the scale range
## (`geom_hline()`).
