add_title_ggplot: Add a title to a ggplot object using cowplot.

Description Usage Arguments Details Examples

View source: R/convenience_funcs.R

Description

add_title_ggplot adds a title to a ggplot object using cowplot.

Usage

1
add_title_ggplot(ggplot_obj, plot_title)

Arguments

ggplot_obj

A ggplot object.

plot_title

A character value for the plot title.

Details

This is useful when the ggplot object aleady has a title (e.g. gene ID) or if it is a faceted plot (e.g. UMAP split by 'orig.ident').

Examples

1
2
3
4
5
# load example dataset from Seurat
data("pbmc_small", package="Seurat")

add_title_ggplot(Seurat::DimPlot(pbmc_small, group.by = "RNA_snn_res.0.8", split.by = "groups"),
paste0("n=",(length(Seurat::Idents(pbmc_small)))))

genomics-kl/seurathelpeR documentation built on Nov. 4, 2019, 1:04 p.m.