我正在创建一个图表,其中geom_bar的长度表示每个人在活动中花费的时间。现在,我想在栏上的activity中添加实例(使用geom_point)。
我读了另一个问题Plotting geom_bar and geom_point together?,它让我走了这么远
library(ggplot2)
plot1<-ggplot(tt,aes(x=Actor,y=Task.Time))+
geom_bar(stat='identity')+
coord_flip()+
xlab("")+
geom_point(data=data.frame(x=0:940,y=0), aes(x=2,y=941))+
geom_point(data=data.frame(x=0:940,y=0), aes(x=1,y=941))

请注意,所用的最大时间为940秒。我需要的实例(geom-point),以停留在酒吧。它们现在存在的点是不正确的。Renee的y值存储在g$Qualifier..Time中的r$Qualifier..Time和Gia中。我还想将点的形状和颜色设置为限定符类型,分别存储在g$Qualifier和r$Qualifier中。谢谢!
发布于 2019-06-04 13:17:12
根据几分钟前操作员的数据:
ggplot(tt,aes(x=Actor,y=Task.Time))+
geom_bar(stat='identity')+
coord_flip()+
xlab("")+
geom_point(data=r, aes(x=2,y=Qualifier..Time)) +
geom_point(data=g, aes(x=1,y=Qualifier..Time))

https://stackoverflow.com/questions/56437363
复制相似问题