我正在尝试使用ggplot2中的geom_point()绘制图形,将变量映射到x、y、颜色和形状,并闪避颜色的位置,但不是形状。
x=tibble(Color=c(rep('A',12),rep('B',12),rep('C',12)),
Shape=rep(c(rep('A',3),rep('B',3),rep('C',3),rep('D',3)),3),
xVar=rep(c('A','B','C'),12),
Value=rnorm(36))
ggplot(x,aes(xVar,Value,color=Color,shape=Shape))+
geom_point(position=position_dodge(width=.5))
有没有可能将闪避位置限制在一个审美上?我已经查阅了文档和Stack Overflow,但还没有找到相关的内容。
ggplot(data=x) + geom_point(aes(xVar, Value, color=Color), position=position_dodge(width=.5)) + geom_point(aes(xVar,Value,shape=Shape))
? - juan