dimred_labels_add: Add labels to DimPlot (or similar ggplot2)

View source: R/dimred_labels.R

dimred_labels_addR Documentation

Add labels to DimPlot (or similar ggplot2)

Description

Sets a new color scale for the added annotation and sets up default aesthetics

Usage

dimred_labels_add(
  labels,
  colors = NULL,
  label_by = 1,
  color_by = 1,
  dim1 = 2,
  dim2 = 3,
  seed = 112,
  label.size = NA,
  fontface = "bold",
  label.padding = unit(0.01, units = "npc"),
  na.rm = TRUE,
  fill = alpha(c("white"), 0.75),
  ...
)

Arguments

labels

data.frame of labels and their positions (i.e. created by scutility::seurat_dimred_cluster_labels)

colors

named vector of colors for each label

label_by

name or index of the column in labels that should be used for labelling

color_by

name or index of the column in labels that should be used for coloring

dim1

name or index of the column in labels that should be used for x

dim2

name or index of the column in labels that should be used for y

...

Passed on to ggrepel::geom_label_repel

Value

list of ggplot2 functions to be added to an existing plot


Terkild/scutility documentation built on Jan. 16, 2025, 5:28 p.m.