Skip to content

Postscript query

3 messages · Ben Bolker, Paul Murrell, Michael Manning

#
You've misunderstood how the postscript() device works, I think.

  You should do

postscript(whatever)
... plot commands ...
dev.off()

dev.print(file="whatever") works more the way you're thinking.

Note, however, that for best results you either (1) want to set your
windows() or x11() device to the same size as your intended output file or
(2) use the postscript()/plot commands/dev.off()  approach; translating
the stored plot commands to a new device isn't always WYSIWYG.
On Tue, 11 Sep 2001, Michael Manning wrote:

            

  
    
#
Hi
The postscript() function only creates a new, _blank_, postscript device.
Subsequent drawing operations, such as plot(), lines(), ..., will go to that
device.

If you have created a graph in a window and want to "save" it to postscript,
you need to either ...
(i)  open a postscript device using postscript() and then rerun the graphics
commands to reproduce your graph on the postscript device, or ...
(ii)  use one of the functions dev.copy(), dev.print(), or dev.copy2eps() to
copy the contents of the window to a postscript device.

Hope that helps.

Paul


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Hi all

I am experiencing some interesting results when I attempt to save
graphical output to a file via "postscript".  I am running R version
1.3.0 on a Mandrake 8.0 system under Xemacs 21.1.14 via ESS 5.1.18. 
Once I have generated a graph, I have attempted to save the graph with
statements like

postscript("myplot.eps",horizontal=FALSE, height=8, width=6)

however, the resulting postscript file appears to be, um, blank (i.e.
when I open the file in the gimp or some other graphics editor, there
isn't anything there).

Feedback?

Regards

Michael Manning
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._