Area-proportional nested rectangles, laid out with the squarified algorithm (Bruls, Huizing & van Wijk 2000) so tiles stay close to square and stay comparable by area.
geom_treemap(
mapping = NULL,
data = NULL,
alpha = NULL,
label = TRUE,
label_size = NULL
)A Layer to add with +.
d <- data.frame(
region = c("North", "South", "East", "West", "Central"),
revenue = c(52, 38, 27, 19, 11)
)
ggnext(d, aes(size = revenue, label = region, color = region)) +
geom_treemap() +
theme_void()
#> <ggnext plot>
#> data: 5 x 2
#> aes: size = revenue, label = region, color = region
#> layers: 1
#> coord: cartesian
#> mode: static