2017-04-25 60 views

回答

6

可以作爲後處理的gtable添加grobs,

library(ggplot2) 
library(gtable) 
library(grid) 

p <- ggplot(data.frame(f=1:2)) + facet_wrap(~f) 

g <- ggplotGrob(p) 
pan <- g$layout[grepl("panel", g$layout$name),] 
g <- gtable_add_cols(g, unit(2,"line"), pos = min(pan$l)+1) 
g <- gtable_add_grob(g, textGrob("+", gp=gpar(cex=2)), l = min(pan$l)+2, t=unique(pan$t)) 

grid.newpage() 
grid.draw(g) 

enter image description here

+0

謝謝!所有降價的原因是什麼? – BNJMNDDNN

相關問題