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

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
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,                  ripley@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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.