ggplot2:geom_point()避开形状但不显示颜色

scs*_*217 0 r ggplot2

我正在尝试使用geom_point()在ggplot2中获得一个具有映射到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))
Run Code Online (Sandbox Code Playgroud)

是否可以将闪避位置限制为仅一种美学?我已经搜索过文档和堆栈溢出,但是还没有发现任何东西。

Axe*_*man 5

group决定闪躲,所以可以这样做:

ggplot(x,aes(xVar,Value,color=Color,shape=Shape,group=Shape))+
  geom_point(position=position_dodge(width=.5))
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明