[R] superscript in figures - basic question

Martin Maechler maechler at stat.math.ethz.ch
Tue Jun 14 09:26:18 CEST 2005


>>>>> "Peter" == Peter Alspach <PAlspach at hortresearch.co.nz>
>>>>>     on Tue, 14 Jun 2005 14:11:47 +1200 writes:

    Peter> Ben

    Peter> Others have pointed out plotmath.  However, for some
    Peter> superscripts (including 2) it may be easier to use
    Peter> the appropriate escape sequence (at in Windows):

    Peter> ylab = 'BA (m\262/ha)'

but please refrain from doing that way.
You should write R code that is portable, and ``plotmath''
has been designed to be portable.  Windows escape codes are not,
and may not even work in future (or current?) versions of
Windows with `unusual' locale settings {fonts, etc}.

Martin Maechler

    Peter> Cheers ........

    Peter> Peter Alspach


    >>>> "Benjamin M. Osborne" <Benjamin.Osborne at uvm.edu>
    >>>> 14/06/05 13:42:53 >>>
    Peter> Although I see similar, but more complex, questions
    Peter> addressed in the help archive, I'm having trouble
    Peter> adding superscripted text to the y-axis labels of
    Peter> some figures, and I can't find anything in the R
    Peter> documentation on this.

    Peter> I have:

    Peter> ylab="BA (m2/ha)"

    Peter> but I want the "2" to be superscripted.  Thanks in
    Peter> advence for the help, or for pointing out the
    Peter> appropriate help file.

    Peter> -Ben Osborne

    Peter> ______________________________________________
    Peter> R-help at stat.math.ethz.ch mailing list
    Peter> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE
    Peter> do read the posting guide!
    Peter> http://www.R-project.org/posting-guide.html

    Peter> ______________________________________________________

    Peter> The contents of this e-mail are privileged and/or
    Peter> confidenti...{{dropped}}

    Peter> ______________________________________________
    Peter> R-help at stat.math.ethz.ch mailing list
    Peter> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE
    Peter> do read the posting guide!
    Peter> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list