r - Set width and height of graphic made using ggplot, grid, and gridExtra -
if have graphic composed of several plots, 3 plots arranged vertically. gtable object , can drawn page with:
grid::grid.newpage() grid::grid.draw(plot)
however see plot in rstudio 'smushed up' in screenshot below:
as can see in bottom right corner squashed , titles overlap other elements of graphic.
if hit zoom , view plot lot bigger:
now know, if export gtable plot using pdf() or png() , such devices, can set width , height, , make big enough such plot not squashed.
however, instead of 1 of graphic devices, use export.grid
, gridsvg package save svg file. if
gridsvg::export.grid(plot)
then svg file exported looks squashed in rstudio plot window. question is, how can manipulate dimensions of graphic drawn svg without looking squashed? draw plot grid.newpage
, grid.draw
, wonder perhaps have specify size of page or drawing using grid.
thanks, ben.
Comments
Post a Comment