powered by
See ugd_render() for accessing plot data directly in memory without saving as a file. This function will only work after starting a device with ugd().
ugd_render()
ugd()
ugd_save( file, page = 0, width = -1, height = -1, zoom = 1, as = "auto", which = dev.cur() )
No return value. Plot will be saved to file.
Filepath to save plot.
Plot page to render. If this is set to 0, the last page will be selected. Can be set to a numeric plot index or plot ID (see ugd_id()).
0
ugd_id()
Width of the plot. If this is set to -1, the last width will be selected.
-1
Height of the plot. If this is set to -1, the last height will be selected.
Zoom level. (For example: 2 corresponds to 200%, 0.5 would be 50%.)
2
0.5
Renderer. When set to "auto" renderer is inferred from the file extension.
"auto"
Which device (ID).
ugd() plot(1, 1) tf <- tempfile() on.exit(unlink(tf)) ugd_save(file = tf, width = 600, height = 400, as = "png") dev.off()
Run the code above in your browser using DataLab