Skip to contents

Plot stacked barplot filled by group

Usage

plot_comp_barplot(
  sobj,
  breaks,
  group,
  stack = TRUE,
  counts = TRUE,
  title = ggplot2::waiver(),
  xlabel = breaks,
  colors = NULL,
  ncol_legend = NULL,
  savename = NULL,
  width = 7,
  height = 7
)

Arguments

sobj

Seurat object

breaks

string; metadata colname in sobj to set breaks / columns

group

string; metadata colname in sobj to split columns by

stack

logical; split into stacked plots of counts + fraction

counts

logical; T to include counts barplot above stacked barplot

title

string; plot title

xlabel

string; x-axis (breaks) label

colors

char vector; list of colors (n = # of unique groups), or "alpha"

ncol_legend

integer; # of legend columns

savename

string; filepath to save plot under

width

numeric; saved plot width

height

numeric; saved plot height

Value

Stacked barplot, filled by group composition