I have data that have the same x and y values but are separated categorically by another variable. However, since they have the same x and y values, I only see one circle in the plot. I want to see each circle clearly separated and on top of each other for the same x/y coordinate.
I've tried using jitter and position_dodge but it doesn't separate the values clearly vertically.
library(ggplot2)
library(scales)
library("RColorBrewer")
x<- c("1","1","1","1","1","1")
y <- c("1","1","1","2","2","2")
z <- c("Treatment 1","Treatment 2","Treatment 3","Treatment 4","Treatment 5","Treatment 6")
data<- data.frame (x,y,z)
ggplot(data=data,aes (x=y, y=x))+
coord_flip()+
geom_point(data=data, aes(x=y, y= x, color = z, pch=16,size =3 ))+
xlab("ID")+
ylab("Time")+
scale_shape_identity()+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust=0.5))
The various treatments should be vertically separated so that we see a circle for each color rather than just one circle. Any help would be much appreciated!