Stacked_VlnPlot {scCustomize} | R Documentation |
Stacked Violin Plot
Description
Code for creating stacked violin plot gene expression.
Usage
Stacked_VlnPlot(
seurat_object,
features,
group.by = NULL,
split.by = NULL,
idents = NULL,
x_lab_rotate = FALSE,
plot_legend = FALSE,
colors_use = NULL,
color_seed = 123,
ggplot_default_colors = FALSE,
plot_spacing = 0.15,
spacing_unit = "cm",
vln_linewidth = NULL,
pt.size = NULL,
raster = NULL,
add.noise = TRUE,
...
)
Arguments
seurat_object |
Seurat object name. |
features |
Features to plot. |
group.by |
Group (color) cells in different ways (for example, orig.ident). |
split.by |
A variable to split the violin plots by, |
idents |
Which classes to include in the plot (default is all). |
x_lab_rotate |
logical or numeric. If logical whether to rotate x-axis labels 45 degrees (Default is FALSE). If numeric must be either 45 or 90. Setting 45 is equivalent to setting TRUE. |
plot_legend |
logical. Adds plot legend containing |
colors_use |
specify color palette to used in |
color_seed |
random seed for the "varibow" palette shuffle if |
ggplot_default_colors |
logical. If |
plot_spacing |
Numerical value specifying the vertical spacing between each plot in the stack.
Default is 0.15 ("cm"). Spacing dependent on unit provided to |
spacing_unit |
Unit to use in specifying vertical spacing between plots. Default is "cm". |
vln_linewidth |
Adjust the linewidth of violin outline. Must be numeric. |
pt.size |
Adjust point size for plotting. Default for |
raster |
Convert points to raster format. Default is NULL which will rasterize by default if greater than 100,000 total points plotted (# Cells x # of features). |
add.noise |
logical, determine if adding a small noise for plotting (Default is TRUE). |
... |
Extra parameters passed to |
Value
A ggplot object
Author(s)
Ming Tang (Original Code), Sam Marsh (Wrap single function, added/modified functionality)
References
See Also
https://twitter.com/tangming2005
Examples
library(Seurat)
Stacked_VlnPlot(seurat_object = pbmc_small, features = c("CD3E", "CD8", "GZMB", "MS4A1"),
x_lab_rotate = TRUE)