[R] how to pause between graphics

Kinoko andzsinszan at gmail.com
Wed Nov 26 02:21:58 CET 2008


Thanks for the answer.

Surely, without popping windows it is a lot more convenient.
This piece of code seems to work for me.

def.par <- par(no.readonly = TRUE)
png(file="thisPlot.png", width = 1200, height = 800, units = "px",
pointsize = 12)

plot(blah-blah...

dev.off()
par(def.par)



best
g



On Nov 26, 1:19 am, Greg Snow <Greg.S... at imail.org> wrote:
> If the reason you want to pause is so that you can save a copy of the graph, or go back and look at earlier ones, then it may be easiest to just write all the graphs to a file to start with.  Use the pdf device, write all the graphs to the pdf file, close the file using dev.off, then open the pdf file and page through the graphs.
>
> Not a direct answer to your question, but hope it helps,
>
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.s... at imail.org
> 801.408.8111
>
>
>
> > -----Original Message-----
> > From: r-help-boun... at r-project.org [mailto:r-help-bounces at r-
> > project.org] On Behalf Of Peter B. Mandeville
> > Sent: Tuesday, November 25, 2008 6:08 AM
> > To: r-h... at r-project.org
> > Subject: [R] how to pause between graphics
>
> > Dear list:
>
> > Before posting this message, I read the posting guide, examined the
> > manuals,
> > searched the R help files, and examined in detail the books that I have
> > available on R.
>
> > I am using R version 2.8.0 and WinXP.
>
> > I want to pause the R Graphics window to permit the use of the File,
> > History, and Resize options between each graphic in a series of
> > graphics. If
> > I use the functions
>
> > par(ask=T)
>
> > or
>
> >        devAskNewPage(ask=T)
>
> > between the graphics there is a pause but one cannot use the File,
> > History,
> > and Resize options. For an example use
>
> > demo(Graphics)
>
> > What I want to do is approximated by the following code:
>
> > trat <- factor(c(rep("A",5),rep("B",5),rep("C",5)))
>
> > trat
>
> > resp <-
> > c(rnorm(5,mean=5,sd=1.75),rnorm(5,mean=6.5,sd=1.75),rnorm(5,mean=15,sd=
> > 1.75)
> > )
>
> > aovOBJ <- aov(resp~trat)
>
> > summary(aovOBJ)
>
> > AOV <- function(aovOBJ){
>
> >   print(tmp <- summary.lm(aovOBJ))
>
> >   boxplot(tmp$resid,col="grey")
>
> >   reply <- readline(prompt="Next:")
>
> >   hist(tmp$resid,freq=F,col="grey",breaks="fd",xlab="",ylab="",main="")
>
> >   xfit <- seq(min(tmp$resid),max(tmp$resid),length=40)
>
> >   yfit <- dnorm(xfit,mean=mean(tmp$resid),sd=sd(tmp$resid))
>
> >   lines(xfit,yfit,col="red")
>
> >   reply <- readline(prompt="Next:")
>
> >   require(car,quietly=T)
>
> >   qq.plot(tmp$resid,ylab="empirical",main="",col="black")
>
> >   detach("package:car")
>
> >   reply <- readline(prompt="Next:")
>
> >   plot(density(tmp$resid),main="")
>
> >   reply <- readline(prompt="Next:")
>
> >   plot.design(aovOBJ$model)
>
> >   reply <- readline(prompt="Next:")
>
> >   tmp <- TukeyHSD(aovOBJ)
>
> >   plot(tmp)
>
> > }
>
> > AOV(aovOBJ)
>
> > There ought to exist a lot easier user friendly way to do this. Does
> > anyone
> > know one?
>
> > Thank you very much,
>
> > pbm
>
> > Peter B. Mandeville
>
> > cel:    444 860 3204
>
> > tel: 52 444 826 2346-49 ext 532
>
> > fax: 52 444 826 2350
>
> > P.D. Favor de confirmar la llegada de este correo. Gracias.
>
> >         [[alternative HTML version deleted]]
>
> > ______________________________________________
> > R-h... at r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guidehttp://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-h... at r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list