From ripley at stats.ox.ac.uk  Tue Apr 18 10:35:28 2006
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 18 Apr 2006 09:35:28 +0100 (BST)
Subject: [Rd] bounding box in PostScript
In-Reply-To: <17476.15129.276232.549991@bossiaea.maths.uwa.edu.au>
References: <5.2.0.9.2.20060417154018.01232ec0@pop.ms.uky.edu>
	<17476.15129.276232.549991@bossiaea.maths.uwa.edu.au>
Message-ID: <Pine.LNX.4.64.0604180925300.19767@gannet.stats.ox.ac.uk>

On Tue, 18 Apr 2006, Berwin A Turlach wrote:

> G'day David,
>
>>>>>> "DA" == David Allen <allen at ms.uky.edu> writes:
>
>    DA> When a graph is saved as PostScript, the bounding box is often
>    DA> too big.  A consequence is that when the graph is included in
>    DA> a LaTeX document, the spacing does not look good.  Is this a
>    DA> recognized problem? Is someone working on it? Could I help?
> How exactly are you saving the graph as PostScript?
>
> I guess the problem is due to the fact that you save the PostScript
> picture on a paper according to your default paper size (which is "a4"
> for me).  To create PostScript pictures with reasonalbe tight bounding
> boxes that are suitable to be included in a LaTeX document you should
> specify `paper=special' and then define your plotting area via the
> 'height' and 'width' argument.

To clarify, the bounding box is always for the device region, not the 
paper, even when (as by default) the device region is centred on the paper 
with 0.25" margins.  The problems with just using postscript() are

1) The plot is rotated (the default for 'horizontal').
2) The text is too normally small for inclusion in other documents, since 
the size is chosen to be appropriate for a whole-page plot.
3) The header may cause the including application not to use the bounding 
box, but for example the DocumentMedia or some inbuilt assumption.

I am pretty sure the perceived problem is the margins on the figure 
region, and the appropriate way is to reduce those vai par(mar=).  (I do 
that for all my books.)

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] bounding box in PostScript
Prof Brian Ripley