When rendering a book in R, Quarto saves the plot images generated in each chapter within the ./chapter_name/figure-html directories. By default, images are saved with a resolution that is good enough for online book websites, but not good enough for printing.
Is there a way to, at least temporarily, generate all ggplots in higher resolution so we can send them to production to print the book ?
ps. The Quarto documentation is great, but they don't mention any info om plot resolutions on their page.
As @tarleb mentioned, setting fig-dpi in the YAML format options is one solution. However, the ggsave() default is already 300, so for printing, 600 might be preferred.
Nonetheless, even better would be using lossless vector graphics. The Quarto PDF Format uses .pdf for figures by default. But that usually doesn't work well with HTML. However, you could set fig-format to svg.
format:
html:
fig-format: svg
https://quarto.org/docs/reference/formats/html#figures
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With