I'm working on a "book" project (quarto-based) with loads of plots. My biggest problem is how to achieve consistency in the plot's appearance: after rendering the book, saved plots deviate from the look I had in the preview pane. E.g.,:
As I understand it, the chunk's options and pane size are not connected in any way, therefore preview is not representative in its appearance. So, my question is how can I link the size of the output plots (i.e., saved on render) and the size of the plots in the preview pane of Rstudio IDE consistent (in both overall size and aspect ratio)?
I'm not sure if this will solve your issue, but if you save your plot with ggsave() and set the width and height to what Quarto uses in the output you should be able to preview the plots that way.
According to the Quarto documention the default html plot dimensions are 7x5 so after making your plot you could run ggsave("test_plot.png", width = 7, height = 5) to see what the plot will look like.
If that doesn't quite match what's in the book you could set the plot width and height globally in the YAML header (see link above) and match those dimensions when calling ggsave().
Thank you for your suggestion.
This is actually what I'm trying to avoid. Of course, ggsave() would be much faster than rendering the whole document. However, it's still a tedious process, especially when you dealing with lots of plots in very different types and shapes.
Another option is to use ggsave() to save all of your plots and then load the .png (for example) files into the quarto document with ![](). In this scenario, your quarto doc might look like the following: