How to use ggplot2 facet colors and shapes?

让人想犯罪 __ 提交于 2020-01-11 14:09:52

问题


Maybe, I missed something in the ggplot grammar. The following 3 facets can be plotted without any error. Unfortuantely, the facet plots mixed up colors and shapes. The right hand column should show blue markers only, while the center one should have green markers.

data1
num     delay claim supply project
1 -236.347551  3000    DIF   site1
2   65.132011  5000    Hoc   site2
3   61.401260  5000    Hoc   site2
4   96.902894   500    Hoc   site2
..
base04 <- ggplot(data1, aes(num, delay, size=claim, color=supply, shape=project))
base04 + geom_point() + facet_grid( . ~ supply ) 
base04 + geom_point() + facet_grid( project ~ . )
base04 + geom_point() + facet_grid( project ~ supply )

Many thanks for your ideas ..

来源:https://stackoverflow.com/questions/44724108/how-to-use-ggplot2-facet-colors-and-shapes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!