我想躲開我的酒吧的位置,但它根本不這樣做,我老實說不知道爲什麼。position_dodge()不閃避
這是我的代碼:
y = c(10.3,12.3,2.3,4.5,6,7.8)
df <- data.frame(
video = factor(c(1, 2, 3, 4, 5, 6)),
ERDERS = y,
group = factor(c(1, 1, 2, 2, 3, 3)))
p1 <- ggplot(df, aes(fill=factor(group), y= ERDERS, x= video))
p1 <- p1 + geom_bar(color = "gray60", stat="identity", position = position_dodge()) +
scale_y_continuous(limits=c(-3, 21), name = "Activity[%]")+ # Y-Axis scaling + title
scale_x_discrete(name = "VIDEO", labels=c("1", "2", "3", "4", "5", "6"))+
theme_bw()
謝謝!
您有六個數據分和6個酒吧,究竟應該回避? – Axeman
總是要躲避其中的兩個,即根據因素組。 –
那麼,應該有一種方法可以將視頻1/2(組1),3/4(組2)和視頻5/6(組3)分組。如果我有6個不同的視頻,我想繪製這些值,我需要六個不同的x值。 –