【发布时间】:2021-01-15 17:29:33
【问题描述】:
我想使用geom_point() 在group 变量的10 个级别上分别可视化y 与A、B 和C 的关系。
我当前的情节只能针对A 绘制y,但我希望B 和C 在每个情节中以不同的颜色显示。
我想知道如何在ggplot2 中实现这一点?
library(ggplot2)
dat <- read.csv('https://raw.githubusercontent.com/rnorouzian/e/master/sng.csv')
ggplot(dat)+aes(x=A, y = y, fill = group)+geom_point()+ # How can I have `B` and `C` next to `A` with other colors
facet_wrap(~group)
【问题讨论】:
标签: r ggplot2 plot data-visualization