save4plots.A4: Save Four Plots on One A4 Page

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

save4plots.A4R Documentation

Save Four Plots on One A4 Page

Description

Arranges and saves four plots (e.g. UMAPs) onto a single A4 page, allowing for a compact comparison of different visualizations or clustering results.

Usage

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

Arguments

plot_list

A list containing ggplot objects to be arranged and saved; each object represents one panel.

pname

Plot name; if FALSE, a name is generated automatically based on plot_list and suffix; Default: FALSE.

suffix

Suffix to be added to the filename; Default: NULL.

scale

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

nrow

Number of rows to arrange the plots in; Default: 2.

ncol

Number of columns to arrange the plots in; Default: 2.

h

Height of the plot canvas, calculated as the height of an A4 page times scale; Default: 8.27 * scale.

w

Width of the plot canvas, calculated as the width of an A4 page times scale; Default: 11.69 * scale.

...

Additional parameters passed to plot_grid.

Examples

## Not run: 
p1 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point()
p2 <- ggplot(mtcars, aes(mpg, disp, color = as.factor(cyl))) +
  geom_point()
p3 <- ggplot(mpg, aes(displ, hwy, color = class)) +
  geom_point()
p4 <- ggplot(diamonds, aes(carat, price, color = cut)) +
  geom_point()
save4plots.A4(plot_list = list(p1, p2, p3, p4))

## End(Not run)


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