d.c.c...@its.leeds.ac.uk
unread,May 8, 2009, 4:26:13 AM5/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
Dear all,
I want to add some annotations to a plot that include plotmath-type
expressions. I can't seem to get this to work.
## make some data
mydata <- data.frame(x = 1:10, y = 1:10)
## plain text works
ggplot(mydata, aes(x, y)) +
geom_point() +
annotate("text", x = 6, y = 7, label = "some text")
## this does not
ggplot(mydata, aes(x, y)) +
geom_point() +
annotate("text", x = 6, y = 7, label = expression(beta[1] == 1))
Error in as.character(x$label) :
cannot coerce type 'closure' to vector of type 'character'
Am I doing something wrong, or is this a problem?
Thanks
David