I wonder how to change the facet label to math formula in ggplot2.
d <- ggplot(diamonds, aes(carat, price, fill = ..density..)) +
xlim(0, 2) + stat_binhex(na.rm = TRUE) + opts(aspect.ratio = 1)
d + facet_wrap(~ color, ncol = 4)

For example, I want to change facet label from D to Y[1], where 1 is subscript. Thanks in advance for your help.
I found this answer but it does not work for me. I’m using R 2.15.1 and ggplot2 0.9.1.
Perhaps somebody has changed the name of the edit-Grob function at some point. (Edit: It was removed by @hadley about 8 months ago.) There is no
geditGrobbut justeditGrobfrom pkg:grid seems to work: