p<-ggplot(dt)
p+aes(P,weight=V,fill=D)+
geom_bar()+
scale_fill_manual(values=c("blue","red","green"))+
scale_x_continuous(breaks=seq(min(dt$P),max(dt$P),0.01))+
poptheme+
coord_flip()
数据示例如下:
> head(dt)
T P V C D
1 9:30 11.16 2 1 B
2 9:30 11.16 159 30 B
3 9:30 11.16 19 6 B
4 9:30 11.17 10 6 B
5 9:30 11.16 13 3 B
6 9:30 11.16 6 5 B
> tail(dt)
T P V C D
2133 14:55 11.25 -50 1 S
2134 14:56 11.25 -5 3 S
2135 14:56 11.25 -30 2 S
2136 14:56 11.25 -22 2 S
2137 14:56 11.26 -48 6 S
2138 15:00 11.25 -231 34
示例图: