Ok, I have reinstalled R-1.9.0 and this appears to have fixed the problems I was having with png(). However, I have a further question regarding png() Is it possible to pass a par() argument to the png() command? I am wanting to produce 4 plots per object, which I normally acheive on an X window by par(mfrow=c(1,4)). I have tried calling a new plot and setting par in this way but this has no bearing when I call png(). Any suggestions? Thanks in advance, Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax: +44 113 343 6716 mail: laura at env.leeds.ac.uk
Are you calling png before your par command--I think you should. > png (file='filename') > par(mfrow=c(1,4)) > plot(1:10) > plot(1:10) > plot(1:10) > plot(1:10) > dev.off() See if that works for you. Sean On Sep 7, 2004, at 10:37 AM, Laura Quinn wrote:> Ok, I have reinstalled R-1.9.0 and this appears to have fixed the > problems I was having with png(). However, I have a further question > regarding png() > > Is it possible to pass a par() argument to the png() command? I am > wanting to produce 4 plots per object, which I normally acheive on an X > window by par(mfrow=c(1,4)). I have tried calling a new plot and > setting > par in this way but this has no bearing when I call png(). > > Any suggestions? > > Thanks in advance, > > Laura Quinn > Institute of Atmospheric Science > School of Earth and Environment > University of Leeds > Leeds > LS2 9JT > > tel: +44 113 343 1596 > fax: +44 113 343 6716 > mail: laura at env.leeds.ac.uk > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
Laura Quinn wrote:> Ok, I have reinstalled R-1.9.0 and this appears to have fixed the > problems I was having with png(). However, I have a further question > regarding png() > > Is it possible to pass a par() argument to the png() command? I am > wanting to produce 4 plots per object, which I normally acheive on an X > window by par(mfrow=c(1,4)). I have tried calling a new plot and setting > par in this way but this has no bearing when I call png().You have to call par() after png() rather than before: png("test.png") par(mfrow=c(1,4)) replicate(4, plot(1:10)) dev.off() Uwe Ligges> Any suggestions? > > Thanks in advance, > > Laura Quinn > Institute of Atmospheric Science > School of Earth and Environment > University of Leeds > Leeds > LS2 9JT > > tel: +44 113 343 1596 > fax: +44 113 343 6716 > mail: laura at env.leeds.ac.uk > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
The following is not a problem in R 1.9.1:> png(file = "test.png") > par(mfrow = c(2,2)) > plot(c(1:10)) > plot(c(1:10)) > plot(c(1:10)) > plot(c(1:10)) > dev.off()null device 1>Have you tried that? HTH, Partha Laura Quinn <laura at env.leeds.ac.uk> Sent by: r-help-bounces at stat.math.ethz.ch 09/07/2004 10:37 AM To: r-help at stat.math.ethz.ch cc: Subject: [R] Further png() question Ok, I have reinstalled R-1.9.0 and this appears to have fixed the problems I was having with png(). However, I have a further question regarding png() Is it possible to pass a par() argument to the png() command? I am wanting to produce 4 plots per object, which I normally acheive on an X window by par(mfrow=c(1,4)). I have tried calling a new plot and setting par in this way but this has no bearing when I call png(). Any suggestions? Thanks in advance, Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax: +44 113 343 6716 mail: laura at env.leeds.ac.uk ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Insert the par() call after png(). par() is device-specific. Andy> From: Laura Quinn > > Ok, I have reinstalled R-1.9.0 and this appears to have fixed the > problems I was having with png(). However, I have a further question > regarding png() > > Is it possible to pass a par() argument to the png() command? I am > wanting to produce 4 plots per object, which I normally > acheive on an X > window by par(mfrow=c(1,4)). I have tried calling a new plot > and setting > par in this way but this has no bearing when I call png(). > > Any suggestions? > > Thanks in advance, > > Laura Quinn > Institute of Atmospheric Science > School of Earth and Environment > University of Leeds > Leeds > LS2 9JT > > tel: +44 113 343 1596 > fax: +44 113 343 6716 > mail: laura at env.leeds.ac.uk > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >
On 7 Sep 2004 at 15:37, Laura Quinn wrote:> Ok, I have reinstalled R-1.9.0 and this appears to have fixed the > problems I was having with png(). However, I have a further question > regarding png() > > Is it possible to pass a par() argument to the png() command? I am > wanting to produce 4 plots per object, which I normally acheive on an > X window by par(mfrow=c(1,4)). I have tried calling a new plot and > setting par in this way but this has no bearing when I call png().Hi png("myplot.png", 800,800) par(mfrow=c(1,4)) for (i in 1:4) boxplot(rnorm(10)*i) dev.off() seems to work or seems to produce 4 graphs on 1 png device. Is this what you want? Cheers Petr> > Any suggestions? > > Thanks in advance, > > Laura Quinn > Institute of Atmospheric Science > School of Earth and Environment > University of Leeds > Leeds > LS2 9JT > > tel: +44 113 343 1596 > fax: +44 113 343 6716 > mail: laura at env.leeds.ac.uk > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlPetr Pikal petr.pikal at precheza.cz
Thanks all! It appears I just had the par in the wrong place in my loop. Laura Quinn Institute of Atmospheric Science School of Earth and Environment University of Leeds Leeds LS2 9JT tel: +44 113 343 1596 fax: +44 113 343 6716 mail: laura at env.leeds.ac.uk On Tue, 7 Sep 2004, Petr Pikal wrote:> > > On 7 Sep 2004 at 15:37, Laura Quinn wrote: > > > Ok, I have reinstalled R-1.9.0 and this appears to have fixed the > > problems I was having with png(). However, I have a further question > > regarding png() > > > > Is it possible to pass a par() argument to the png() command? I am > > wanting to produce 4 plots per object, which I normally acheive on an > > X window by par(mfrow=c(1,4)). I have tried calling a new plot and > > setting par in this way but this has no bearing when I call png(). > > Hi > > png("myplot.png", 800,800) > par(mfrow=c(1,4)) > for (i in 1:4) boxplot(rnorm(10)*i) > dev.off() > > seems to work or seems to produce 4 graphs on 1 png device. Is > this what you want? > > Cheers > Petr > > > > > > > > Any suggestions? > > > > Thanks in advance, > > > > Laura Quinn > > Institute of Atmospheric Science > > School of Earth and Environment > > University of Leeds > > Leeds > > LS2 9JT > > > > tel: +44 113 343 1596 > > fax: +44 113 343 6716 > > mail: laura at env.leeds.ac.uk > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! > > http://www.R-project.org/posting-guide.html > > Petr Pikal > petr.pikal at precheza.cz > > >