-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
In ggplot2, we cast all guide dimensions to centimetres, which may be detrimental for adaptive sizing needed for dynamically wrapped text for example.
It leads to a miscommunication of the guide's size, leading to awkward results.
library(ggplot2)
ggplot(mpg, aes(displ, hwy, colour = drv)) +
geom_point() +
scale_colour_discrete(
name = textshaping::lorem_text(),
guide = marquee::guide_marquee()
) +
theme(panel.widths = unit(5, "cm"))
#> Warning in split.default(glyphs, rep(seq_len(n_breaks), each = n_layers)): data
#> length is not a multiple of split variable
#> Warning in max(unlist(width)): no non-missing arguments to max; returning -Inf
#> Warning in max(unlist(height)): no non-missing arguments to max; returning -Inf
Created on 2025-08-27 with reprex v2.1.1