Parsing greek letters in facet_wrap titles

902 views
Skip to first unread message

hefin....@gmail.com

unread,
Feb 1, 2017, 5:50:17 AM2/1/17
to ggplot2
Hi all, please consider the data and plot generated by this code:
library(ggplot2)

df
<- data.frame(x = rnorm(100, 100, 20), y = rnorm(100, 100, 20),
                 
group = rep(c("IFNa", "IFNb"), each = 50))

ggplot
(data = df, aes(x, y)) + facet_wrap(~group) + geom_point()

Instead of IFNa and IFNb, I would like the titles to read IFNα and IFNβ. I have tried using:
+ facet_wrap(~group, labeller = label_parsed)

but I'm not sure what format my group labels should be in. I tried the format:
paste("IFN","alpha")

but this didn't work. Can anyone please suggest a way to do this and combine standard latin text and greek letters in my facet_wrap titles?

Thank you
Hefin

Brandon Hurr

unread,
Feb 1, 2017, 11:09:50 AM2/1/17
to hefin....@gmail.com, ggplot2
Hefin, 

I think try solutions here:


The parsed labels you have to create yourself I think. 

Brandon

--
--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages