하나는 눈금 및 레이블의 위치를 반전하기 때문에
library(gtable)
g <- ggplotGrob(p)
strips <- gtable_filter(g, "strip_t", trim=FALSE)
grid.newpage()
grid.draw(rbind(g, strips[3,], size="first"))
축, 그러나 더 많은주의를 필요로 패싯 스트립 얻기. 당신은 아마
tweak_axis <- function(a){
inner <- a[["children"]]["axis"][[1]]
inner[["grobs"]] <- rev(inner[["grobs"]])
inner$grobs[[2]]$y <- inner$grobs[[2]]$y - unit(0.15, "cm")
a[["children"]]["axis"][[1]] <- inner
a
}
axes <- gtable_filter(g, "axis_b", trim=FALSE)
axes$grobs <- lapply(axes$grobs, tweak_axis)
grid.newpage()
grid.draw(axes)
편집이 시작 할 수 있습니다, 위의 기반으로 "완전한"솔루션이 될 수있다 (명백한 사항에 유의)
grid.newpage()
g2 <- g
new_axes <- lapply(g2$grobs[grepl("axis_b", g2$layout$name)], tweak_axis)
g$grobs[grepl("strip_t", g$layout$name)] <- new_axes
g$grobs[grepl("axis_b", g$layout$name)] <- g2$grobs[grepl("strip_t", g2$layout$name)]
# heights should be changed too, but it's kind of ok here
xlab <- 7; title <- 1:2
grid.draw(rbind(g[xlab,], g[-c(title, xlab), ], size="last"))
이 질문에 대한 답변이 [this] (http://stackoverflow.com/q/3261597/324364) 또는 [t 그의] (http://stackoverflow.com/q/10058839/324364). – joran
나쁜 소식처럼 보입니다 ... 아마도 주제에서 벗어나지 만 격자가이 기능을 제공하는지 궁금합니다. – wesmantooth