save2plots.A4: Save Two Plots on One A4 Page

View source: R/Seurat.Utils.Visualization.R

save2plots.A4R Documentation

Save Two Plots on One A4 Page

Description

Arranges and saves two UMAP plots (or any plots) side-by-side or one above the other on a single A4 page.

Usage

save2plots.A4(
  plot_list,
  pname = FALSE,
  suffix = NULL,
  scale = 1,
  nrow = 2,
  ncol = 1,
  h = 11.69 * scale,
  w = 8.27 * scale,
  ...
)

Arguments

plot_list

A list containing ggplot objects to be arranged and saved.

pname

Boolean indicating if the plot name should be automatically generated; if FALSE, the name is based on plot_list and suffix; Default: FALSE.

suffix

Suffix to be added to the generated filename if pname is FALSE; Default: NULL.

scale

Scaling factor for adjusting the plot size; Default: 1.

nrow

Number of rows in the plot arrangement; Default: 2.

ncol

Number of columns in the plot arrangement; Default: 1.

h

Height of the plot, calculated as A4 height times scale; calculated dynamically based on scale.

w

Width of the plot, calculated as A4 width times scale; calculated dynamically based on scale.

...

Additional parameters passed to plot_grid.

Examples

## Not run: 
p1 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point()
p2 <- ggplot(iris, aes(Petal.Length, Petal.Width, color = Species)) +
  geom_point()
save2plots.A4(plot_list = list(p1, p2))

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.