From p.dalgaard@biostat.ku.dk  Fri Oct 26 22:48:04 2001
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 26 Oct 2001 23:48:04 +0200
Subject: [Rd] postscript problem (PR#1147)
In-Reply-To: <Pine.LNX.4.33.0110262221290.506-100000@kleigh.nl>
References: <Pine.LNX.4.33.0110262221290.506-100000@kleigh.nl>
Message-ID: <x2bsiut6nf.fsf@blueberry.kubism.ku.dk>

Peter Kleiweg <kleiweg@let.rug.nl> writes:

> kjetilh@umsanet.edu.bo scribeva...
> 
> > I reported this earlier, and have got reports that others have the same
> > promlem on UNIX machines, so it is not only a windows problem
> > S I file a bug report.
> >
> > The function (boot.stat) given at the end produces a postscript file,
> > which cannot be included correctly in LaTeX. Specifically,
> > the image in LaTeX (when translated by dvips to postscript)
> > becomes very small, not using the bounding box, and turned on its head!
> 
> I tested this. There is definitely something wrong with the
> PostScript output. The first command that is called that does
> something in the graphics state is 'cl', and this command starts
> with a 'grestore'. So, there is a call to 'grestore' in the
> PostScipt file that was not preceeded by a call to 'gsave'. The
> result is the undoing of a 'gsave' in the embedding code.
> 
> I compared the PostScript code to the code that was generated
> with another graphic that didn't cause any problemns. Seems that
> what is missing in the defective code is a call to 'bp' at the
> start. Inserting this command before the first call to 'cl'
> fixes the problem.
> 
> Why 'bp' is missing is something someone else should figure out.

Thanks for the analysis. For debugging, the following minimal example
may be helpful

b<-
function () 
{
    split.screen(c(1, 2))
    screen(1)
    plot(0)
}
b();postscript();b();dev.off()

notice that it will not happen unless you plot to the screen first.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] postscript problem (PR#1147)
Peter Dalgaard BSA