[R] 回复: Italicize Greek symbols in axis

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 21 17:18:52 CEST 2011


On Tue, 21 Jun 2011, Duncan Murdoch wrote:

> On 11-06-21 8:15 AM, Bingzhang Chen wrote:
>> Prof. Ripley,
>> 
>> Thanks. A stupid question: how to find out the codes (e.g.,u03bc)  for the 
>> Greek
>> letters?
>
> That's a Unicode code point, so you can look it up online, e.g. here:
>
> http://inamidst.com/stuff/unidata/
>
> The mu is in the "Greek and Coptic" section.  Not all R graphics devices have 
> access to the same fonts, so experiment a bit before you make a choice.

My preferred source is

http://www.alanwood.net/unicode/index.html#links

People on Windows can also use the character map (select e.g. MS Arial 
Unicode).  With Rgui you can as you say copy-and-paste, but not with 
Rterm -- but the character map does display the Unicode point. 
(Because you did not give your platform I had to give the most general 
solution.)

>
> Duncan Murdoch
>
>> 
>> I am trying to italicize the mu in a mathematical expression placed as a 
>> label
>> for an axis of a graph (but other letters remain plain). I am working on 
>> the
>> Windows platform. I seem to find out a solution: to copy the µ from the
>> character map and use  italic(µ) in the expression.
>> 
>> Bingzhang
>> 
>> 
>> 
>> ----- 原始邮件 ----
>> 发件人: Prof Brian Ripley<ripley at stats.ox.ac.uk>
>> 收件人: Bingzhang Chen<elanchen2001 at yahoo.com.cn>
>> 抄   送: r-help at r-project.org
>> 发送日期: 2011/6/21 (周二) 5:56:05 下午
>> 主   题: Re: [R] Italicize Greek symbols in axis
>> 
>> On Tue, 21 Jun 2011, Bingzhang Chen wrote:
>> 
>>> Hello there,
>>> 
>>> Is there any way to italicize Greek symbols such as mu in axis? From the 
>>> help
>>> files of mathematical anotations: "Note that bold, italic and bolditalic 
>>> do
>> not
>>> apply to symbols, and hence not to the Greek symbols such as mu which are
>>> displayed in the symbol font.  They also do not apply to numeric 
>>> constants.",
>>> it
>>> seems that it cannot be done.
>> 
>> That refers to the mathematical symbol mu and not the Greek letter mu (it 
>> is not
>> clear what you are actually quoting: maybe because in ?plotmath 'symbols' 
>> is
>> emphasized).  And ?plotmath goes on to say
>>
>>    This can often be used to display Greek \emph{letters} in bold or 
>> italic.
>> 
>> Did you try that?  So see if  "\u03bc" works, e.g.
>> 
>> plot(1:10)
>> text(5, 2, "\u03bc", font = 3)
>> 
>> On most devices there is no italic symbol font, and even if it were 
>> available,
>> it is not included in the R graphics model of fonts 1:5. If you do have 
>> such a
>> font family, you should be able to set it up as the 'family' argument of 
>> your
>> (unspecified) graphics device.
>> 
>> Note that there is no italic version of the Adobe symbol font in the 
>> standard
>> implementation of PDF nor postscript nor X11 nor in the Windows font set 
>> (and
>> hence as far as I aware neither in the Apple version of those TrueType 
>> fonts).
>> Some devices, e.g. those using cairographics, may synthesize an italic 
>> symbol
>> font from glyphs in non-symbol fonts.
>> 
>> Please do remember to include the 'at a minimum' information requested in 
>> the
>> posting guide: much better answers to questions like this can be given if 
>> you
>> specify the platform and graphics device you use.
>> 
>> 
>>> Thanks,
>>> Bingzhang Chen
>> 
>> -- 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
>> 
>> 
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide 
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
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-help mailing list