When creating plots in RStudio to be used in a presentation, how do you export them?

  • 7 April 2022
  • 5 replies
  • 106 views

Userlevel 3
Badge +1

I’m interested in knowing how people typically save their plots from RStudio. 

Are there any ways you’ve found to be super quick and easy, or alternatively anything that should be avoided? E.g. maybe a certain way always skews the dimensions.

Would be great if you could vote on the poll below so I can see what the most commonly used method is!

How do you export your plots?


5 replies

Userlevel 6
Badge +2

I find the export button handy as you can easily set the height and width of the images, so if you’re making a presentation and want them all to be exactly the same size then it’s easy to make them consistent! I have used ggsave in the past but I had some issues with trying to set the dpi (dots per inch) to make the resolution right, I’m not sure if I was just using it wrong but it often didn’t seem to work the way I was expecting!

Userlevel 3
Badge +1

I export to pdf with a consistent resolution, and save in the project directory. If I need to put it in a deck I open it up, zoom in, and screenshot as Google docs don’t support pdfs yet!

Userlevel 1

I think it is best practice to have images which are of a consistent aspect ratio and DPI and something which I can easily reproduce (we have all been in situations where we have made some great graphs and someone has just asked for a slight tweak on a label or colour!). To do this I often use the options which are available in RMarkdown chunks : fig.width, fig.height and dpi. Then when I have run the code chunk I can copy them out into wherever I want my figure to be displayed - this has the great benefit that these settings are stored in code and can be kept safely in a code repo like GitHub!

Userlevel 2
Badge

For the sake of consistency, it is easiest to click the export button and you can choose the resolution (600x400 is favoured by our team). I know some people actually save the image but you could quickly end up with 100s of plots if you’re not careful!

Userlevel 2
Badge

I too use the export button but have felt the DPI looks sacrificed at times so this post has been a great help! 

Reply