View source: R/ipea_label_size.R
| ipea_label_size | R Documentation |
Converts a font size in points (pt) into the size
argument/aesthetic (in mm) expected by ggplot2::geom_text(),
ggplot2::geom_label() and similar geoms. ggplot2 specifies text size
for geoms in mm and internally converts it to points by multiplying by
2.845276 (72.27/25.4); this helper performs the inverse conversion so
that labels are rendered at an exact point size.
ipea_label_size(pt = 6)
pt |
Numeric. Desired font size in points. Defaults to |
A numeric value (in mm) to be passed to the size
argument/aesthetic of ggplot2::geom_text(), ggplot2::geom_label()
or similar geoms.
Other ggplot2 theme functions:
ipea_contrast_color(),
scale_color_ipea(),
scale_fill_ipea(),
theme_ipea()
library(ggplot2)
ggplot(mtcars[1:5, ], aes(hp, mpg, label = round(mpg))) +
geom_text(size = ipea_label_size(), colour = "black") +
theme_ipea()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.