Re: axis label with a symbol in superscript mode

301 views
Skip to first unread message

Dennis Murphy

unread,
Mar 3, 2013, 3:03:24 AM3/3/13
to ume...@gmail.com, ggp...@googlegroups.com
Hi:

Try

ggplot(data.frame(x = 1, y = 1), aes(x, y)) + geom_point() +
ylab(expression(T[2]^"*"*group("(", s, ")")))

Dennis

On Sat, Mar 2, 2013 at 1:09 PM, <ume...@gmail.com> wrote:
> Dear All,
> I am trying to get the following y-axis label in my ggplot
> Tsubscript(2)superscript(*) (s) i.e., in Tex, it would be T$_{2}^{*}$ (s).
>
> I tried to get there with the following ggplot command
> ...+ylab(expression(paste(T[2]{*},"(s)",sep="")))
>
> However, this does not work. Specifically, if I replace * with simple text
> (letters and numerals), it works fine. Can somebody suggest what needs to be
> changed to get the expected y-axis label?
>
> Regards,
> Umesh
>
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ggplot2+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

ume...@gmail.com

unread,
Mar 3, 2013, 4:30:24 AM3/3/13
to ggp...@googlegroups.com, ume...@gmail.com
Hi Dennis,
That gives exactly what I want. Thanks a lot. I would not have come up with it in a month for sure :-).

Regards,
Umesh
Reply all
Reply to author
Forward
0 new messages