On 10/03/2010 12:43 AM, Mike Marchywka wrote:
> 
> 
> Hi,
> I'd been using R in the past and recently installed it on a new windoze 7 
> machine.
> There have been many issues with compatibility and 32/64 bit apps etc and I 
> did
> find on google on isolated complaint that saveplot failed in scripts a long 
> time ago.
> R seems to work fine except script-based plot saving as pdf has not worked.
> I have tried the following, none of which seem to function,
> 
> 
> xyz <-read.table("time_frac2")
> x=plot(xyz,main="imp rate", xlab="Time(GMT)",ylab="imp/minute")
> grid()
> 
> dev2bitmap("xxx.pdf",type="pdfwrite")
> save.plot(x,file="xxx.pdf",format="pdf")
> dev.copy("pdf","auto_pdf.pdf")
> dev.off()
> savePlot("./auto_hit_rate.pdf",type="pdf")
> 
> q()
> 
> 
> 
> Now apparently R does save the plot in a default file Rplots.pdf which is
> just fine for my immediate needs but this may have limitations for future
> usages.
> 
> Just curious to know what other may have gotten to work or not work.

You likely do not have plot recording on the device you open by default
in batch processing. Copying to a different device relies on that.

I'd just open the pdf device explicitly:

pdf(file="foo.pdf")
plot(xyz,main="imp rate", xlab="Time(GMT)",ylab="imp/minute")
grid()
dev.off()

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd....@cbs.dk  Priv: pda...@gmail.com

______________________________________________
R-help@r-project.org 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