标签:
R代码
ggplot(channel2,aes(x=factor(Name),,fill=Type)) +geom_bar(aes(y=Amount,fill=factor(Type)),stat="identity" ,width=0.3)
+geom_bar(aes(y=Amount2,fill=factor(Type)),stat="identity" ,width=.2 ) #主要就是靠 width 的数字来控制的
数据:
Name | Type | Amount | Amount2 |
A | 期初库存 | 842 | |
A | 采购 | 96,907 | |
A | 销售 | 94,541 | |
A | 期末库存 | 3,250 | |
B | 期初库存 | 493 | |
B | 采购 | 58,210 | |
B | 销售 | 58,321 | |
B | 期末库存 | 381 | |
C | 期初库存 | 1,215 | |
C | 采购 | 56,999 | |
C | 销售 | 54,540 | |
C | 期末库存 | 3,373 |
标签:
原文地址:http://www.cnblogs.com/LearningForR/p/4648883.html