让我们考虑以下示例:
library(ggplot2)
zzz <- data.frame(gp = c("a","b","c","d","e","f","g","h","i","j","k","l","m"),
c1 = c(1,1,1,1,1,1,1,1,1,1,1,1,1),
c2 = c(1,1,1,1,1,1,1,1,1,1,1,1,1))
ggplot(zzz, aes(x = c1, y = c2)) +
facet_wrap(~ gp, scales = "free", strip.position = "bottom") +
geom_point() +
theme(
aspect.ratio = 1,
strip.background = element_blank(),
strip.placement = "outside"
)
为什么我会出现以下错误?我该如何克服它?
Error in vapply(row_axes, is.zero, logical(length(row_axes))) :
values must be length 3,
but FUN(X[[1]]) result is length 1
我测试过一些调整,发现如果:
a)我从数据框中删除一行,或者添加2行,并为每个新组添加一个组名,则没有问题,或者
b)我删除strip.placement =“outside”
或strip.position =“bottom”
那是一个bug吗? 我错过了什么吗? 我想保留美学的条纹设置...