Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

savePlotAsImage

Save active RStudio plot image


Description

Save the plot currently displayed in the Plots pane as an image.

Usage

savePlotAsImage(
  file,
  format = c("png", "jpeg", "bmp", "tiff", "emf", "svg", "eps"),
  width,
  height
)

Arguments

file

The target file path.

format

The Image format. Must be one of ("png", "jpeg", "bmp", "tiff", "emf", "svg", or "eps").

width

The image width, in pixels.

height

The image height, in pixels.

Note

The savePlotAsImage function was introduced in RStudio 1.1.57.


rstudioapi

Safely Access the RStudio API

v0.13
MIT + file LICENSE
Authors
Kevin Ushey [aut, cre], JJ Allaire [aut], Hadley Wickham [aut], Gary Ritchie [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.