[R] Size problem with two dotcharts side by side

Jean lobry lobry at biomserv.univ-lyon1.fr
Fri Oct 20 04:47:32 CEST 2006


Dear list,

I'm answering to my own question.

I found that it is possible to reproduce the behavior in the interactive
mode this way:

quartz() # start a new device (I have also tried with x11() under Linux
          # and windows() under windows with the same result.
dotchart(1:10, cex = 0.7) # first call
dotchart(1:10, cex = 0.7) # second call

The plot region is smaller in the second call than in the first one,
and then stable on further calls.

I found that saving/retauring par("mar") allowed me to have the
same plot region so that this Sweave code:

\documentclass{article}
\begin{document}
<<fig=T,width=8,height=4>>=
par(mfrow = c(1, 2), cex = 0.7)
omar <- par("mar")
for(i in 1:2){
par(mar  = omar)
dotchart(1:10)
}
@
\end{document}

gave me two dotcharts side by side without size problem:
http://pbil.univ-lyon1.fr/members/lobry/mini2.pdf

Best,

Jean Lobry


P.-S. I don't understand why I have to do that because the dotchart()
function code starts with:

opar <- par("mai", "cex", "yaxs")
on.exit(par(opar))

so that I was understanding that margins were restaured on exit.
-- 
Jean R. Lobry            (lobry at biomserv.univ-lyon1.fr)
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56     fax    : +33 472 43 13 88
http://pbil.univ-lyon1.fr/members/lobry/



More information about the R-help mailing list