Another way to transfer plots is to transfer the display list.  
This is a list of the low level plot commands that R produces.

For example, on Linux do this:

   dev.control(displaylist="enable") # enable display list
   plot(1:10)
   myplot <- recordPlot()  # load displaylist into variable
   save(myplot, file="myplot", ascii=TRUE)

Send the ascii file, myplot, to the Windows machine and on Windows do this:

   dev.control(displaylist="enable") # enable display list
   load("myplot")
   myplot # displays the plot
   savePlot("myplot", type="wmf")  # saves current plot as wmf

I don't have Linux to actually try this out but perhaps someone
with both can try it out.

---
Date:   Sun, 22 Feb 2004 21:13:37 +0530 
From:   Ajay Shah <[EMAIL PROTECTED]>
To:   <[EMAIL PROTECTED]> 
Subject:   Re: [R] R: Including R plots in a Microsoft Word document 

 
It was pointed out that while 

win.metafile("/myfile.wmf")

is useful, it only works on windows.

Here's a path which would work on Unix:

1) Write an xfig file using R. I use something like :

xfig(file="created.fig", onefile=TRUE, bg="LightSkyBlue", width=5, height=3)
plot()

This is a very smart path to take if you want to manually touch up
the picture in xfig (leave aside the Windows problem).

2) The program fig2dev converts .fig files into many file formats,
including one "cgm" which is reputed to feed well into Microsoft
software. I have no Windows here, however, and can't try this out.


Now for a (perhaps trivial) question: Several people said you have to
do

win.metafile("/myfile.wmf")
plot(1:10)
dev.off() <-------- this is essential

Why is the 3rd line essential? I have been feeding R programs into R
using the command

$ R --vanilla < file.R

and I find things work just fine without having a dev.off()
command. E.g. I have this program which seems to work fine:

A <- read.table(
file="datafile.2",
na.strings=".",
col.names=c("date","dlinrchf","dlusdchf","dljpychf","dldemchf")
)
xfig(file="created.fig", onefile=TRUE, bg="LightSkyBlue", width=5, height=3)
plot(A$dlusdchf, A$dlinrchf,
xlab="USD/CHF returns",
ylab="INR/CHF returns",
col = "dark red")

-ans.

-- 
Ajay Shah Consultant
[EMAIL PROTECTED] Department of Economic Affairs
http://www.mayin.org/ajayshah Ministry of Finance, New Delhi

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to