Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ggplot2 geom_point 3D ball shape

Tags:

r

ggplot2

I'd like to generate ggplot2 scatter plot clearly shows pileup of points within clusters.

I am using ggplot2 draw tSNE/Umap of single cell RNAseq data that displays multiple clusters. What I need is a script that allows me to show pileups of individual points within a cluster more clearly.

This ggplot2 script was used to generate a following plot with no pileup;

ggplot(ap.int.dt,aes(UMAP_1,UMAP_2,color=immgen.main))
+geom_point(size=1, shape=1,alpha=0.3)
+scale_color_manual(values =color_clusters)

No_pileup

This is a plot that I'd like to generate (generated by a SinglerR package and a companion visualization web site).

Plot_pileup

like image 538
akh22 Avatar asked Feb 02 '26 09:02

akh22


1 Answers

Are you looking for an outlines on your points? Youll need to use 'shape' 21-25 because these have both 'fill' and 'color' properties.

ggplot(df) + geom_point(aes(x = V1,y = V2), shape=21, color = 'black', fill = "green", size = 4) + geom_point(mapping = aes(x = V1.1,y = V2.1))

enter image description here

like image 150
Henry Holm Avatar answered Feb 04 '26 22:02

Henry Holm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!