remove scientific notation in geom_text

582 views
Skip to first unread message

Adam

unread,
Oct 12, 2011, 8:41:28 AM10/12/11
to ggplot2
Hello,

I'm currently trying to produce a figure with R^2 and p-values placed
within the figure itself (see code below). I don't seem to have any
problems with the basics of this code, however, I can't seem to get
the p-values such as P < 0.0001 listed without scientific notation
when I used geom_text. I'm sure there's a simple way of doing this,
but I haven't figured it out yet. Any help is much appreciated.

Thanks,
Adam

a.plot <- qplot(ova.energy.resids, spawn, data=prob.spawn.new22)
a.plot + stat_smooth(method='glm', family='binomial', size=1,
colour='black') +
geom_point(colour="black") +
scale_x_continuous("", limits=c(-14000,14000),
breaks=seq(-15000,15000, 7500)) +
scale_y_continuous("", breaks=seq(0,1,.2)) +
geom_text(aes(x, y, label=caption),parse=T,
data.frame(x=10000,y=0.2,caption="atop(italic(R)^2==0.32,
italic(P) < 0.0001)", size=10)

Allan

unread,
Oct 12, 2011, 11:46:05 AM10/12/11
to ggplot2
This works for me - single quotes to treat the number as character

a.plot <- qplot(1:10,1:10)
a.plot + geom_text(aes(x, y, label=caption),parse=T,
data.frame(x=5,y=2,caption="atop(italic(R)^2==0.32,
italic(P) < '0.0001')", size=10))

-Allan (R 2.13.1, ggplot2 0.8.9)
Reply all
Reply to author
Forward
0 new messages