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

Update code of showing the default size of geom_text() #6084

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
4 changes: 2 additions & 2 deletions vignettes/articles/faq-customising.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,10 @@ ggplot(mpg, aes(x = hwy, y = cty)) +

### What is the default size of `geom_text()` and how can I change the font size of `geom_text()`?

The default font size of `geom_text()` is 3.88.
The default font size of `geom_text()` is about 3.87.

```{r}
GeomLabel$default_aes$size
get_geom_defaults(geom_text)$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))`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we recommend theme(geom = element_geom()) instead of update_geom_defaults()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's the question... In general, should update_geom_defaults() be soft-deprecated after the next release? I think theme(geom = element_geom()) is more preferable in more cases, but we need to discuss and decide what the official recommendation should be.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point, I've made #6085 as a breakout for discussing this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Let's discuss there.

Expand Down
Loading