Skip to content
Back to formatted view

Raw Message

Message-ID: <16128.38587.620427.830712@arbres1a.fmr.com>
Date: 2003-06-30T19:59:55Z
From: David Brahm
Subject: dev.copy()

In a batch script (i.e. there is no screen device), I would like to create both
a PDF file and a PNG file from the same plot.  I thought this would be the way
to do it, but it isn't:

 R> bitmap("copy.png", "png16m", res=300)
 R> pdf("copy.pdf")
 R> plot(1:10, 1:10)     # Plot into pdf file
 R> dev.copy(which=2)    # Copy to png file
 R> dev.off(3)           # Close pdf
 R> dev.off(2)           # Close png

The PDF comes out fine, but the PNG appears blank.  Any ideas what I'm doing
wrong?  TIA.
-- 
                              -- David Brahm (brahm at alum.mit.edu)