[Rd] unexpected behaviour of expression(sum())
Prof Brian Ripley
ripley at stats.ox.ac.uk
Fri Mar 11 08:19:25 CET 2005
On Thu, 10 Mar 2005, Marc Schwartz wrote:
> On Thu, 2005-03-10 at 19:57 -0600, Deepayan Sarkar wrote:
>> I'm seeing inconsistent symbols from the same expression with the
>> following code:
>>
>>
>> expr = expression(sum(x, 1, n))
>> plot(1, main = expr, type = "n")
>> text(1, 1, expr)
>>
>>
>> Moreover, the inconsistency is reversed in r-devel compared to R 2.0.1.
>> In particular, the main label shows a \bigoplus instead of \sum in
>> r-devel, and the other way round in 2.0.1. demo(plotmath) shows \sum in
>> both.
>>
>> Can anyone confirm? Is this intended behaviour (though I can't see how)?
>
>
> No problem in "Version 2.0.1 Patched (2005-03-07)". I get \sum in both
> places. I do not see anything in the NEWS file suggesting a bug fix for
> this.
>
> I just installed "Version 2.1.0 Under development (unstable)
> (2005-03-11)" and do not see the problem there either.
>
> Both are under FC3.
We need to know both the device and the locale. Assuming this is X11,
there are two fixes for font selection:
o X11() was only scaling its fonts to pointsize if the dpi
was within 0.5 of 100dpi.
o X11() font selection was looking for any symbol font, and
sometimes got e.g. bold italic if the server has such a font.
The main title in plot() and text() are asking for different sizes.
If Deepayan had problems with getting a valid (Adobe symbol-encoded) font,
this might vary by size which would explain the reported differences.
Deepayan: can you please check what symbol fonts you have: the pattern in
R-devel is
"-adobe-symbol-medium-r-*-*-*-*-*-*-*-*-*-*"
(Ideally we would select on encoding, but that is usually 'fontspecific'
so not helpful.)
Brian
--
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
More information about the R-devel
mailing list