
Save a VISTA plot object to disk
save_vista_plot.RdSaves plot objects returned by VISTA plotting functions to file. Supports
both ggplot-like objects (saved via ggplot2::ggsave()) and
ComplexHeatmap objects (Heatmap / HeatmapList) saved via graphics
devices.
Usage
save_vista_plot(
plot,
file,
width = 8,
height = 6,
units = "in",
dpi = 300,
device = NULL,
...
)Arguments
- plot
A plot object. Typically
ggplot,patchwork,Heatmap, orHeatmapList.- file
Output file path.
- width
Plot width.
- height
Plot height.
- units
Units for
widthandheight. One of"in","cm","mm", or"px".- dpi
Resolution for raster outputs.
- device
Optional graphics device (e.g.
"png","pdf"). IfNULL, inferred fromfileextension (defaults to"png"when missing).- ...
Additional arguments passed to
ggplot2::ggsave()for ggplot-like objects.
Examples
v <- example_vista()
p <- get_pca_plot(v)
out_file <- tempfile(fileext = ".pdf")
save_vista_plot(p, file = out_file, width = 7, height = 5, units = "in")