Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a minor note about the difference of the unit of size to FAQ #5446

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading