我有这个情节
library(ggplot2)
library(reshape)
x = c("Band 1", "Band 2", "Band 3")
y1 = c("1","2","3")
y2 = c("2","3","4")
to_plot <- data.frame(x=x,y1=y1,y2=y2)
melted<-melt(to_plot, id="x")
ggplot(melted,aes(x=x,y=value,fill=variable)) +
geom_bar(stat="identity",position = "identity", alpha=.3 ,width = .3)
是否可以:
(1)使变量= y1的宽度为.3,变量= y2为.5
(2)make variable = y1始终是顶栏
谢谢
答案 0 :(得分:1)