-
Notifications
You must be signed in to change notification settings - Fork 81
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
Default to ragg graphics device if available for rendering #393
Comments
I agree it's nice to use ragg where possible. Just for your information, you should be able to change the graphic device by setting the chunk option. If you do not want to include the line, you can use #+ setup, include=FALSE
knitr::opts_chunk$set(dev = "ragg_png")
#+ main
library(ggplot2)
ggplot(mtcars, aes(mpg, cyl)) +
geom_point() +
theme_minimal(base_family = "Jokerman") (I found this trick on this issue: #214. I hope setting chunk options will get easier in future....) |
Aha! I didn't know you could set chunk options in a reprex. In that case, I'm not sure if it makes sense for reprex to change the default graphics device? Not sure if it's on the roadmap for R Markdown, but maybe they will make Thanks so much @yutannihilation! library(ggplot2)
ggplot(mtcars, aes(mpg, cyl)) +
geom_point() +
theme_minimal(base_family = "Jokerman") Created on 2021-09-04 by the reprex package (v2.0.0) |
Ah, not sure about their plan, but this sounds better. |
I think specifying a non-default graphics device should remain the responsibility of the user (or maybe we'll eventually inherit a different default choice from rmarkdown/knitr). In general, I try to not to sign reprex up for jobs that are unrelated to its core mission of providing convenience features around rendering small examples. Even the ability to specify chunk options via |
I was recently trying to make a reprex that used custom fonts and I couldn't figure out a way to specify the graphic device used for rendering the reprex. Because of this (on my Windows machine) I wasn't able to use a custom font in my ggplot reprex. Since ragg/systemfonts seems to work quite well across all OS, would it make sense to set ragg as the default graphics device for the R Markdown's rendered by reprex?
Recently,
ggplot2::ggsave()
made ragg the default device if it is installed.Created on 2021-09-03 by the reprex package (v2.0.0)
The text was updated successfully, but these errors were encountered: