Modifying the shape for a subset of points with ggplot2

前端 未结 1 1008
长情又很酷
长情又很酷 2021-02-02 16:38

I\'m attempting to plot a large scatter plot that varies along a large number of dimensions.

Here\'s my starting plot:

 p <- ggplot(mtcars, aes(wt, m         


        
相关标签:
1条回答
  • 2021-02-02 17:16

    Instead of initially putting your variables within the ggplot function, try to map your variables individually for every layer you add.

    p <- ggplot(data = mtcars)+
    geom_point(aes(wt, mpg, shape=as.factor(cyl), colour=gear, size=carb))+
    geom_point(aes(wt[carb==8], mpg[carb==8]), colour="black", shape=1, size=7)  
    

    img

    0 讨论(0)
提交回复
热议问题