Skip to content
Prev 11730 / 398502 Next

Par and the size of the page

Hi
A couple of things you could try ...

(i)  Use the par(mar) to increase the margins around the plots.  For
example,

split.screen(c(2,1))
screen(1)
par(mar=c(10, 5, 4, 2))
x <- 1:10
plot(x)
box("figure", lty="dashed")
screen (2)
par(mar=c(5, 5, 10, 2))
plot(x)
box("figure", lty="dashed")
close.screen(all=TRUE)

(ii)  Use par(mfrow) instead of split.screen() -- its much more reliable.
For example,

par(mfrow=c(2,1))
par(mar=c(10, 5, 4, 2))
x <- 1:10
plot(x)
box("figure", lty="dashed")
par(mar=c(5, 5, 10, 2))
plot(x)
box("figure", lty="dashed")

(iii)  Stick an empty plot between the plots.  For example,
(NOTE if you are using R version > 1.2.1 then this might not work;  please
do NOT report this bug - it has been fixed for the upcoming 1.3 release
already)

par(mfrow=c(3,1), mar=c(5.1, 4.1, 4.1, 2.1))
plot(x)
box("figure", lty="dashed")
plot.new()
plot(x)
box("figure", lty="dashed")

(iv)  Control the space between the plots more accurately with a layout.
For example,

layout(matrix(c(1, 0, 2), ncol=1),
       heights=c(1, lcm(5), 1))
plot(x)
box("figure", lty="dashed")
plot(x)
box("figure", lty="dashed")


Hope that helps

Paul


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._