How to add expressions or greek letters with annotation?

878 views
Skip to first unread message

Herbert Jägle

unread,
Jan 6, 2010, 2:58:46 PM1/6/10
to ggplot2
Hi,

i tried to add some text to a plot using annotate. Unfortunately i did
not find how to add any text including expression or greek letters.

Using

txt <- expression(mu * 'V')
annotate("text", x=0.12, y=0.12, label=txt, size=2)

just adds the text "mu * "V"".

Thanks,
Herbert

baptiste auguie

unread,
Jan 6, 2010, 3:26:51 PM1/6/10
to Herbert Jägle, ggplot2
Hi,

geom_text has a parse argument for this,

qplot(1,1,geom="blank") +
annotate("text", x=1,y=1,label="alpha", parse=TRUE)

HTH,

baptiste

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> To post to this group, send email to ggp...@googlegroups.com
> To unsubscribe from this group, send email to
> ggplot2+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/ggplot2
>

Reply all
Reply to author
Forward
0 new messages