grid_arrange_shared_axes: Common-Legend Arrangement of Plots

View source: R/plots.R

grid_arrange_shared_axesR Documentation

Common-Legend Arrangement of Plots

Description

This function creates a common legend for the given pots to share This was taken from the following link: https://github.com/tidyverse/ggplot2/wiki/Share-a-legend-between-two-ggplot2-graphs

Usage

grid_arrange_shared_axes(
  ...,
  list = NULL,
  ncol = NULL,
  nrow = 1,
  widths = NULL,
  title = NULL,
  xlab = NULL,
  ylab = NULL,
  fontfamily = "CM Roman",
  pdf_default = TRUE
)

Arguments

...

A series of plots to share common axes.

list

A list of plots to share common axes. Defaults to NULL. If list is specified, ellipsis argument is ignored.

ncol

Number of columns of the arranged plots. Defaults to NULL, in which case it is the length of the list.

nrow

Number of rows of the arranged plots

widths

Width to control the plot size.

title

Plot-specific titles. Defaults to NULL.

xlab

Common x-axis title to plots. Defaults to first plot's.

ylab

Common y-axis title to plots. Defaults to first plot's.

fontfamily

Font family to be used in common axes labels. Defaults to CM Roman.

pdf_default

Whether to apply pdf_default, which can reset 'theme'.


sysilviakim/Kmisc documentation built on Jan. 28, 2023, 10:58 a.m.