CellChat icon indicating copy to clipboard operation
CellChat copied to clipboard

plotGeneExpression add legend

Open hahia opened this issue 3 years ago • 2 comments

Does anyone know how to add legend on plotGeneExpression when I use the split.by parameter? thank you for your help.

hahia avatar Sep 03 '21 03:09 hahia

@hahia The order of the violin plot is based on the factor order in the 'split.by' variable. I will take a look to see how to add one.

sqjin avatar Sep 10 '21 05:09 sqjin

In the modify_vlnplot function the legend.position is set to "none". If you alter that you will get a legend for each separte violin plot. If you want one legend for the entire plot then add + plot_layout(guides = "collect") to the p <- patchwork::wrap_plots(plotlist = plot_list, ncol = 1) in the StackedVlnPlot function

csijcs avatar Mar 16 '22 08:03 csijcs