Skip to content

Commit

Permalink
Add a minor note about the difference of the unit of size to FAQ (#5446)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Dec 15, 2023
1 parent 24dfd6e commit 9367b48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vignettes/articles/faq-customising.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,12 @@ GeomLabel$default_aes$size

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))`.

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

<details>

<summary>See example</summary>
Expand Down

0 comments on commit 9367b48

Please sign in to comment.