Code Deom
pacman::p_load(Seurat,dplyr,ggplot2)
remotes::install_github("sajuukLyu/ggunchull")
DimPlot(seurat.object)$data %>% ggplot(aes(UMAP_1,UMAP_2,color = ident,fill = ident)) +
ggunchull::stat_unchull(alpha = .3, size = .8,linetype = 2,show.legend = F,
sfac = 1.8, nbin = 150 ,qval = .5
) +
geom_point(pch = 21,size = 3,color = "black",stroke = 0.1) +
tidydr::theme_dr() + theme(panel.grid = element_blank(),
plot.margin = unit( c(0.1,0.15,0.1,0.1),"npc"),
plot.title = element_text(face = 2,size = 20,hjust = 0.5)) +
guides(color = guide_legend(override.aes = list(size= 7))) +
scale_color_brewer(palette = "Paired") +
scale_fill_brewer(palette = "Paired") +
labs(title = "UMAP")
Reference
sajuukLyu/ggunchull: A ggplot extension for drawing smooth non-convex circles around a set of points. (github.com)