将grid.draw的结果保存到ggplot对象
我需要帮助保存将grid.draw的结果保存到ggplot对象,r,ggplot2,R,Ggplot2,我需要帮助保存网格的结果。将绘制到ggplot图形对象 我可以使用网格保存修改ggplot的结果 savepdf("H:\\plot name", width = 36, height = 28) gt <- ggplotGrob(plot1) gt$layout$clip[gt$layout$name=="panel"] <- "off" grid.draw(gt) dev.off() # plot1 is the ggplot object that was amended
网格的结果。将绘制到ggplot图形对象
我可以使用网格保存修改ggplot的结果
savepdf("H:\\plot name", width = 36, height = 28)
gt <- ggplotGrob(plot1)
gt$layout$clip[gt$layout$name=="panel"] <- "off"
grid.draw(gt)
dev.off()
# plot1 is the ggplot object that was amended as follows
plot1 = plot1 + annotation_custom(grob = textGrob("my text", gp=gpar(fontsize=15)),
xmin = this.much,
xmax = this.much,
ymin = -that.much,
ymax = -that.much )
savepdf(“H:\\plot name”,宽=36,高=28)
gt为什么不在ggplot2?或ggsave(“file.pdf”,arrangeGrob(grobs=lappy(字母[1:3],函数(txt)arrangeGrob(ggplot(),bottom=txt)))中使用新的标题功能呢?