Here is my dataset 'cellcounts':
Treatment DAPI DAPO DAPU
1 DMSO 20 30 40
2 DMSO 24 26 42
3 DMSO 23 24 39
4 EPZ 0.5uM 10 25 22
5 EPZ 0.5uM 12 24 22
6 EPZ 0.5uM 14 24 30
7 EPZ 0.5uM 20 19 32
I am trying to create a violin scatter plot with the Treatment groups on the x-axis and the cell counts (DAPI, DAPO, DAPU) on the y-axis, so in total I should have six violin plots.
p1<-ggplot(cellcounts,aes(x=Treatment,y=DAPI)) +geom_violin(aes(colour="DAPI"),alpha=0.5)+ geom_jitter(data=cellcounts,shape=16,position=position_jitter(0.2),colour="blue")+ geom_boxplot(width=0.1,fill="grey")
Obtains a Violin plot with box plot and scatter point shown here
I can add the Violin plots for the DAPO and DAPU data also shown here with
p2<-p1+geom_violin(aes(Treatment,DAPO,colour="DAPO"),alpha=0.5)
p3<-p2+geom_violin(aes(Treatment,DAPU,colour="DAPU"),alpha=0.5)
If I try to add the jitter plot now with
p3+geom_jitter(data=cellcounts,shape=16,position=position_jitter(0.2),colour="blue")
it is only added for the DAPI data as this is what's used the the ggplot demand (?) how can I add the data points for the DAPO and DAPU data also?
I also want DAPI Violin and jitter points to be blue, DAPO green and DAPU red.
Thank you for your time