Here is a function that I have used to write the files on my Windows
machine.  I put this function call after each graph that I produce and it
will write out a new file and tell me what the file name is.  I can then go
back and copy the files into a document or a PowerPoint presentation.


f.plot <- local({
    # PlotNumber is 'local' to the function
    PlotNumber <- 1 # initialize the plot number
    function(){   # return the function
      myplot <- sprintf("ws.%03d.wmf", PlotNumber)
      dev.copy(win.metafile, file=myplot, width=10, height=7)
      PlotNumber <<- PlotNumber + 1  # increment for next plot
      cat("copied to:", myplot, "\n")
      invisible(dev.off())  # close the file
    }
})

At the end of each plotting sequence, just call "f.plot()" to save the
image.


On 3/6/07, John Sorkin <[EMAIL PROTECTED]> wrote:
>
> I have written an R function that produces multiple graphs. I use
> par(ask=TRUE) to allow for the inspection of each graph before the next
> graph is drawn. I am looking for a way to recall all graphs drawn in an
> R session, and a method that can be used to print all the graphs at one
> time. I know that I could simply print each graph after I inspect the
> graph, but this gets tiresome if one's function produces tens of graphs.
> I suspect that if I knew more about the history menu (which currently
> has an entry RECORDING) I could get the graphs to be replayed and
> printed, but alas I have not been able to find instructions for using
> the HISTORY menu. Please take pity on my  when you let me know that some
> easy search or command could get me the information I needed. I have
> looked, but clearly in the wrong places.
> John
>
>
> John Sorkin M.D., Ph.D.
> Chief, Biostatistics and Informatics
> Baltimore VA Medical Center GRECC,
> University of Maryland School of Medicine Claude D. Pepper OAIC,
> University of Maryland Clinical Nutrition Research Unit, and
> Baltimore VA Center Stroke of Excellence
>
> University of Maryland School of Medicine
> Division of Gerontology
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
>
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
> [EMAIL PROTECTED]
> Confidentiality Statement:
> This email message, including any attachments, is for the so...{{dropped}}
>
> ______________________________________________
> R-help@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
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

        [[alternative HTML version deleted]]

______________________________________________
R-help@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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to