From MSchwartz at mn.rr.com  Fri Jan 20 14:48:59 2006
From: MSchwartz at mn.rr.com (Marc Schwartz)
Date: Fri, 20 Jan 2006 07:48:59 -0600
Subject: [Rd] par(mfg=) and postscript and pdf
In-Reply-To: <Pine.LNX.4.61.0601200727470.25948@gannet.stats>
References: <Pine.LNX.4.61.0601200727470.25948@gannet.stats>
Message-ID: <1137764939.4335.3.camel@localhost.localdomain>

On Fri, 2006-01-20 at 07:47 +0000, Prof Brian Ripley wrote:
> This is related to the incorrect bug report PR#7820.  Marc Schwartz
> pointed out in
> 
> https://stat.ethz.ch/pipermail/r-devel/2005-April/033016.html
> 
> an example of a real problem.  If you call par(mfg=) after par(mfrow) (or 
> mfcol) and before you have done any plotting, NewPage is not called on the 
> device at the start of the first page.  That causes the DSC comments to be 
> incorrect on postscript() and much worse on pdf().
> 
> You would get the same effect by calling par(new=T) before plot.new() is 
> called, except that is disallowed.  par(mfg=) does set new=T internally, 
> and also sets the plot number to a valid one, both of which inhibit 
> calling NewPage.  I've managed to overcome this by ensuring that
> GNewPage always calls NewPage on an unused device (there is an internal 
> 'state' variable which records the latter).
> 
> This is safe in the sense that the worst it could do is to produce an 
> unwanted new page.  I can't see how this could happen but the design of 
> the internals of base graphics is very complicated and undocumented, so I 
> am only putting the change in R-devel (along with fixes to the 
> long-standing graphics bugs PR#1235 and PR#2630).


Prof. Ripley,

Thanks for your follow up on this issue. Your efforts in resolution are
greatly appreciated.

Best regards,

Marc Schwartz



[Rd] par(mfg=) and postscript and pdf
Marc Schwartz