Skip to content

Commit 9367b48

Browse files
Add a minor note about the difference of the unit of size to FAQ (#5446)
1 parent 24dfd6e commit 9367b48

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vignettes/articles/faq-customising.Rmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,12 @@ GeomLabel$default_aes$size
505505

506506
You can change the size using the `size` argument in `geom_text()` for a single plot. If you want to use the same updated size, you can set this with `update_geom_defaults()`, e.g. `update_geom_defaults("text", list(size = 6))`.
507507

508+
One tricky thing is that this `size` is in **mm** while the `size` of `element_text()` is in pt.
509+
If you want to match `geom_text()`'s font size to the theme's size,
510+
specify `size.unit = "pt"` in `geom_text()` for a single plot,
511+
or divide the number by the `.pt` constant variable for `update_geom_defaults()`.
512+
Please refer to ["Font size" section of the aesthetic specifications](https://ggplot2.tidyverse.org/articles/ggplot2-specs.html#font-size) for more details.
513+
508514
<details>
509515

510516
<summary>See example</summary>

0 commit comments

Comments
 (0)