[R] PostScript output error

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu Sep 9 08:31:20 CEST 1999


On Wed, 8 Sep 1999, Mitsuru Oka wrote:

> 
> Hello,
> 
> I'm currently using R-0.65.0 with --gnome option in
> configure on IRIX64 and Debian GNU/Linux.
> 
> I found a problem in generated postscript file which
> has following sequence:
> 
>   x <- 1:30
>   postscript("output.ps")
>   par(mfg=c(1,1,2,2))
>   plot(x,sin(x))
>   plot(x,sin(x))
>   plot(x,sin(x))
>   plot(x,sin(x))
>   dev.off()
> 
> The generated postscript file "output.ps" can't be
> interpreted by Aladdin Ghostscript 5.10.
> 
>   Error: /undefined in ps
>   Operand stack:
>      (0)   0.5   0.0
>   Execution stack:
>      %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   2   3   %oparray_pop   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   5   3   %oparray_pop
>   Dictionary stack:
>      --dict:781/809--   --dict:0/20--   --dict:89/200--
>   Current allocation mode is local
>   Current file position is 3092
> 
> 
> What is a problem in my program or R?

Your R code, primarily.

I get that error too. But you need

   x <- 1:30
   par(mfcol=c(2,2))
   plot(x,sin(x))
....

As?par says

     mfg: A numerical vector of the form `c(i, j, nr, nc)'
          where `i' and `j' indicate which figure in an
          `nr'-by-`nc' array of figures is currently being
          drawn.

and you need to set up the array first, by setting parameter mfrow or
mfcol.

I have to say that this would be hard to really understand from the help
page, but it is quite clearly explaind in the recommended R documentation
(as both Rnotes and Venables & Ripley have the same original source for
this, Bill Venables).

S, which is being copied here, just draws 4 superimposed plots.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list