I would like to increase the size of my margins without altering the size of my plot region. What I'm doing is:
- plotting my data, then querying the values of mai (margin size in inches) and fin (figure region dimension in inches).
- adjusting mai by one inch at bottom and left.
- adjusting fin by one inch for width and one inch for height.
- re-plotting data.
However, I always get the error:
Error in plot.new() : figure region too large
Can anyone help? There's obviously something I don't understand about how mai and fin interact.
Here is an example:
x=c(1,2)
y=c(2,4)
plot(x,y)
init_fin <- par("fin") #gives 7 7
init_mai <- par("mai") #gives 1.02 0.82 0.82 0.42
final_fin <- init_fin + 1 #now 8 8
par(mai=c(2.02,1.82,0.82,0.42), fin=final_fin)
plot(x,y)
ERROR:
Error in plot.new() : figure region too large