[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-mac
Subject:    Re: [R-SIG-Mac] XQuartz
From:       Prof Brian Ripley <ripley () stats ! ox ! ac ! uk>
Date:       2013-09-25 16:51:04
Message-ID: 52431478.3060003 () stats ! ox ! ac ! uk
[Download RAW message or body]

And what does any of this have to do with XQuartz?  That is the 
third-party X11 server/sub-system for OS X.  Perhaps the quartz() device 
was meant ....

For the sake of those reading the archives, can we have a much clearer 
statement of the actual problem?  There might be better solutions, 
including quartz(type = "pdf') (which is closer to what 'Save As' from 
the quartz() device does).


On 25/09/2013 13:31, R Erickson wrote:
> Thanks for sharing this! I always wondered what was the trick for
> creating multistage PDFs from R.
> 
> On Tue, Sep 24, 2013 at 4:19 PM, R. Michael Weylandt
> <michael.weylandt@gmail.com> <michael.weylandt@gmail.com> wrote:
> > 
> > 
> > On Sep 24, 2013, at 13:16, R Erickson <raerickson@gmail.com> wrote:
> > 
> > > Hi Paul,
> > > 
> > > Rather than use XQuartz, avoid "printing" the image and use the
> > > pdf()/def.off() commands. Here's an example that I think answers your
> > > question:
> > > 
> > > for(i in 1:10){
> > > x <- i*1:10
> > > y <- sqrt(x)
> > > pdf(paste("File",i,".pdf",sep=""))
> > > plot(x,y, main = paste("Test Case",i),type = 'l')
> > > dev.off()
> > > }
> > 
> > Or, move pdf() before and dev.off() after the loop and make one big file with all \
> > the graphs on different pages. 
> > M
> > > 
> > > Note that the paste function gives you the file name within the pdf
> > > function. Check out the ?pdf file to see how to change the width,
> > > height, or file type.
> > > 
> > > If you are using ggplot2, ggsave can do similar things.
> > > 
> > > Does this help?
> > > 
> > > Richard
> > > 
> > > On Tue, Sep 24, 2013 at 12:01 PM, Paul Ossenbruggen <pjo@cisunix.unh.edu> \
> > > wrote:
> > > > I am generating within a loop a large number of XQuartz images. I know that I \
> > > > can use the Save As command to save each one individually. This is very time \
> > > > consuming and tedious. Is it possible to save them  automatically with a R \
> > > > script command? 
> > > > Thanks for any tip that one can offer.
> > > > 
> > > > Paul


-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

_______________________________________________
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic