Re: [R] Weird blank spacing in plot title when using \n and plotmath

From: Prof Brian Ripley <>
Date: Sat 06 May 2006 - 17:35:32 EST

This is only 'wierd' if you expect plotmath to understand how '\n' will be rendered. Where do you see that documented?

In reality plotmath is computing the width of your string from the printable characters: see plotmath.c:RenderStr.

If you compare your example with

plot(1:10, main=expression(paste("ExposureTemp (", degree*F, ")")))

You will see that the final part is in exactly the same place, and also that your version is not centred vertically.

On Fri, 5 May 2006, Dav Aren wrote:

> Dear R-helpers,
> I have been using \n in my plot titles to split long titles into two lines. I recently tried combining \n and plotmath which still gives me two lines for the title but also a weird blank spacing. A simple example is as follows:
> plot(1:10, main=expression(paste("Exposure\nTemp (", degree*F, ")")))
> Is there something I'm missing to close the spacing. I have searched the R-help archives to no avail. I am using R-2.3.0 with Windows XP.
> Thank you in advance for any help.
> D. Arenas

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Sat May 06 17:37:53 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 06 May 2006 - 20:09:58 EST.

Mailing list information is available at Please read the posting guide before posting to the list.