1

I would like to add annotate text with the label:

lambda = £5,000/Q. 

But where lambda is a Greek letter.

Parse inside text doesn't accept £ or ,

All the guidance online seems to point towards combining text. So "5000/Q" is not a problem but I really would like the £ and the ,.

Any ideas?

Edit because perhaps I wasn't clear enough that it is the character symbols (£ and ,) that are giving me troubles.

Let's take this as an example:

ggplot(data=data.frame(y=c(1,2,3),x=c(1,2,3)), aes(y=y, x=x)) + geom_point() + annotate("text", label="lambda", x=2, y=2.5, parse=T)

No problem, right? Now try and add a '£' symbol.

ggplot(data=data.frame(y=c(1,2,3),x=c(1,2,3)), aes(y=y, x=x)) + geom_point() + annotate("text", label="lambda~£", x=2, y=2.5, parse=T)

And here's the error:

Error: <text>:1:8: unexpected input
1: lambda~£
           ^

This has not been addressed in any other stackoverflow post to my knowledge.

Any ideas?

jnam27
  • 1,367
  • 2
  • 12
  • 16
  • see [here](http://stackoverflow.com/questions/15125628/putting-mathematical-symbols-and-subscripts-mixed-with-regular-letters-in-r-ggpl) – Philippe Jul 10 '14 at 13:16
  • possible duplicate of [How to use Greek symbols in ggplot2?](http://stackoverflow.com/questions/5293715/how-to-use-greek-symbols-in-ggplot2) – tonytonov Jul 11 '14 at 05:56
  • I've seen both of those posts but neither of them use special character symbols £ or ,. I can also easily put in an equals sign and some letters. But I cannot put a £ or , with those methods. Any ideas? – jnam27 Jul 11 '14 at 09:47
  • how about `parse = FALSE` and `label="λ = £5.000/Q"` – baptiste Jul 11 '14 at 11:43
  • I think a solution is here: http://stackoverflow.com/questions/14697718/how-to-create-a-quoted-expression-from-strings/29450079#29450079 – JStrahl Apr 13 '15 at 15:36

0 Answers0