我想畫一個barplot,顯示了產品生產技術和industry2酒吧在每個峯Barplot與GGPLOT2
library(ggplot2)
peaks=c(-3:3)
industry1=c(0.05,0.1,0.2,0.3,0.2,0.1,0.05)
data1=data.frame(peaks,industry1)
industry2=c(0.2,0.15,0.12,0.06,0.12,0.15,0.2)
data2=data.frame(peaks,industry2)
ggplot(data=data1,aes(x=peaks,y=industry1,fill=industry1) + geom_bar(stat="identity", position="stack")
gg=g+geom_bar(data=data2,aes(x=peaks,y=industry2,col="blue",show_guide=TRUE))
如果我運行它,它說,它不工作
是準確,謝謝 –