Saving plots using grid_draw method instead of gridExtra

▼魔方 西西 提交于 2019-12-05 20:32:33

Forgot to mention that width and height of png ( ) will depend on the plot you have so play around with it.

This is how gtable object is saved:

depending on the plot, the dimensions of the png can be adjusted to properly fit the plot

png("g.png",width = 1000, height = 600, units = "px") 
grid.draw(g) 
dev.off()

This should work.

png("g.png", plot=grod.draw(g), width = 1000, height = 600, units = "px")
dev.off()
ggsave('g.png', plot = g, width=6,height=4,dpi=600)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!