我想用ggplot到archieve以下情节类型点:绘制每n观察
使用下面的数据:
t <- read.table(header=T, row.names=NULL,
colClasses=c(rep("factor",3),"numeric"), text=
"week team level n.persons
1 A 1 50
1 A 2 20
1 A 3 30
1 B 1 50
1 B 2 20
2 A 2 20
2 A 3 40
2 A 4 20
2 B 3 30
2 B 4 20")
到目前为止,通过应用这种转变
t0 <- t[ rep(1:nrow(t), t$n.persons %/% 10) , ]
and plotting
ggplot(t0) + aes(x=week, y=level, fill=team) +
geom_dotplot(binaxis="y", stackdir="center",
position=position_dodge(width=0.2)
我可以生成
答:如何archieve不同团队的垂直点闪避相互不重叠?
B:有没有可能是点的全包始终处于居中,即 如果在一个地方只有一支球队的点没有发生闪避?
我给这里的气泡图表类似的解决方案:http://stackoverflow.com/questions/26757026/bubble-chart-with-ggplot2/26769996#26769996 geom_jitter可能是你在这里寻找。它会移动点。结合alpha透明度,它可以提供一个工作解决方案。 – Docconcoct