Is there any way to reduce the amount of whitespace around pie charts generated using the base plotting tools in R?
I'd like to create a multi-panel figure but I can't figure out a way to reduce the amount of whitespace around the plot.
Example code:
par(mfrow=c(2,1))
pie(1:5)
pie(rep(1,5))
I tried playing with mar
, omi
, and oma
within par()
, but all values for those vectors seem to already be set to zero, and negative values are not accepted. Any way around this?
Graphical Parameters about the margin size of plots:
mai
: the margin size in inchesmar
: the margin size in lines of textomi
: the size of the outer margins in inchesoma
: the size of the outer margins in lines of textAll above are specified with a numerical vector of the form c(bottom, left, top, right)
.
The default value of mai
is :
> par("mai")
[1] 1.02 0.82 0.82 0.42
You can reset it as:
> par(mfrow = c(2, 1), mai = c(0, 0, 0, 0))