Re: [R] multiple plots without for loops

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Wed, 16 Jun 2010 09:50:38 +0200

Hi

I use an option with PDF, which can have multi page output. You can

pdf("some_graphs.pdf")

# do all your plotting let say in cycle something like

for( i in 1:n) plot(something[,1], something[,i+1], ...)

dev.off()

You will get one multipage pdf document in working directory which you can get through and delete if you do not want it.

Regards
Petr

r-help-bounces_at_r-project.org napsal dne 16.06.2010 06:05:22:

> Beautiful! Thanks Peter and Phil for your kind help-
>
> sherri
>
>
> Quoting Peter Alspach <Peter.Alspach_at_plantandfood.co.nz>:
>
> > Tena koe Sherri
> >
> > You could turn on graphics recording (if you are using Windows click
> > History on the graphics window and choose recording). Then you can
page
> > up/down to view them. If you save.image on exit, you'll probably want
> > to rm(.SavedPlots) (I think that's the correct name. ls(all=TRUE)
will
> > confirm it) first.
> >
> > HTH .......
> >
> > Peter Alspach
> >
> >> -----Original Message-----
> >> From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-
> >> project.org] On Behalf Of sheck_at_ucar.edu
> >> Sent: Wednesday, 16 June 2010 3:27 p.m.
> >> To: Phil Spector
> >> Cc: r-help_at_r-project.org
> >> Subject: Re: [R] multiple plots without for loops
> >>
> >> Thanks for the reply, Phil.
> >>
> >> My computer gets hung up on the par(ask=TRUE) call. I just tried
> >>
> >> readline("Hit <ENTER> to proceed.")
> >>
> >> and, it works well going forward. However, I cannot go backwards. Any
> >> thoughts?
> >>
> >> thanks again-
> >>
> >> sherri
> >>
> >> Quoting Phil Spector <spector_at_stat.berkeley.edu>:
> >>
> >> > Sherri -
> >> > Perhaps calling
> >> >
> >> > par(ask=TRUE)
> >> >
> >> > before plotting would be useful. (You'll be prompted to
> >> > hit Return to see the next plot in the series.)
> >> >
> >> > - Phil Spector
> >> > Statistical Computing Facility
> >> > Department of Statistics
> >> > UC Berkeley
> >> > spector_at_stat.berkeley.edu
> >> >
> >> >
> >> > On Tue, 15 Jun 2010, sheck_at_ucar.edu wrote:
> >> >
> >> >> Dear All-
> >> >>
> >> >> I am trying to plot over one hundred figures. I do not want to
> > save
> >> >> them, just walk through them to take a look. If I run the code as
> >> >> it is below, then the plots just rapidly run through. I tried
> >> >> adding a new device, but I reached the device number limit. I
have
> >> >> gone through the online manuals, done google searches and the R
> >> >> Site help pages and haven't found anything to help me. any
thoughts
> >> >> or just pointing me to the right place would be great! I feel like
> >> >> this should be simple!
> >> >>
> >> >> invisible(lapply(split(agg$mph, breaks), function(.values){
> >> >> #x11()
> >> >> #par(mfrow=c(4, 4))
> >> >> plot(.values)
> >> >> } ))
> >> >>
> >> >>
> >> >> Thanks in advance for any guidance,
> >> >>
> >> >> Sherri Heck
> >> >>
> >> >> ______________________________________________
> >> >> R-help_at_r-project.org mailing list
> >> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> >> PLEASE do read the posting guide http://www.R-project.org/posting-
> >> guide.html
> >> >> and provide commented, minimal, self-contained, reproducible code.
> >> >>
> >> >
> >>
> >> ______________________________________________
> >> R-help_at_r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide http://www.R-project.org/posting-
> >> guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 16 Jun 2010 - 07:56:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 Jun 2010 - 09:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive