tags:

views:

80

answers:

1

I wonder if it's possible to slice a graph respectively a .png file generated with ggsave. If I do not want to use the default legend ort title and set it to FALSE it leaves me with a lot of white space. So is there an R way to just cut the file several pixels above and below the graph itself?

Thx in advance!

+2  A: 

You could change the plot.margin, e.g.

p + opts(plot.margin=unit(c(-1, 0, -1, 0), "lines"))
rcs
Thx, great idea! ggplot is so hilarious, all these options are really impressive. Though I can't really control my graph's bottom margin so far... (using "cm").
ran2
does this margin work like css margin / padding definitions ? I was able to look up "unit" but could not figure out how top,bottom,left,right works in this case.
ran2