0
library(ggplot2)
set.seed(2)
a = sort(rep(c("A","B"),6))
b = c(rep(1:3,2),rep(4:6,2))
cc = rnorm(length(a))
d = rep(sort(rep(1:2,3)),2)
df = data.frame(a,b,cc,d)
print(df)
ggplot(df, aes(x = as.factor(b), y = cc, fill = as.factor(d))) +
geom_bar(stat = "identity", position = "dodge") +
facet_wrap(~a)
在以下情节: 如何除掉冗余x轴值的每一个的,即“A” &“B”的因素。 我的意思是“A”不需要4:6,而“B”也是1:3。 我需要做些什么调整?ggplot去除冗余x轴值
哇它是那么容易......很抱歉打扰应该有更多。愚蠢的我。 – 2014-09-03 10:16:45