[R] empty postscript output of figures

Thomas W Blackwell tblackw at umich.edu
Fri Sep 26 17:45:31 CEST 2003


Andreas  -

help("postscript") says:

"Arguments: file: ... For use with 'onefile=FALSE'
   give a 'printf' format such as `"Rplot%03d.ps"'
   (the default in that case)."

The "%03d" will be replaced with a three digit number
in the actual file name.  This allows  postscript() to
generate a distinct file name for each plot.  Try this
and see if it helps.  Do read the help.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Fri, 26 Sep 2003, Andreas Cordes wrote:

> I have a puzzeling problem. I want to export graphics from R to TeX via
> postscript(). This works fine for some graphs, but for others, the eps
> remain empty when viewed with GSView. When such an empty eps is imported
> to TeX, the figure appears upside down and very small, irrespective of
> TeX width and height commands. If I transform the eps to pdf, the
> graphic shows up, but turned aqround 90°. It appears that, when printing
> the figures to the gaphics window in R, the background is grey, while it
> is white for those graphics that are properly printed to file. All
> postscript commands are followed by a dev.off() command after the
> plotting commands. I have R running under WinXP .
>
> Here an example of malfunctioning code.
>
> postscript("ex6_pic1.eps", width =6, height = 9,
> horizontal = F, onefile = FALSE, paper = "special")
> par(mfrow=c(2,1));
> par(mfg=c(1,1));
> plot(bidia,weight,xlab="birthweight",ylab="head diameter");
> abline(birth.lm1$coefficients);
> par(mfg=c(2,1));
> plot(abdcir,weight,xlab="birthweight",ylab="abdomnial circumference");
> abline(birth.lm2$coefficients);
> dev.off()
>
> Hope you can help me.
> Best
> Andreas




More information about the R-help mailing list