开发者

Slicing plots generated by ggplot2

开发者 https://www.devze.com 2023-01-12 04:56 出处:网络
I wonder if it\'s possible to slice a graph respectively a .png file generated with ggsave. If I do 开发者_StackOverflownot want to use the default legend ort title and set it to FALSE it leaves me wi

I wonder if it's possible to slice a graph respectively a .png file generated with ggsave. If I do 开发者_StackOverflownot 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!


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

p + opts(plot.margin=unit(c(-1, 0, -1, 0), "lines"))

Since version 0.9.2 opts has been replaced by theme:

p + theme(plot.margin = unit(c(-1, 0, -1, -), "lines"))
0

精彩评论

暂无评论...
验证码 换一张
取 消