[R] main title x title and y title with ggplot2

h.wickham at gmail.com h.wickham at gmail.com
Wed Mar 5 14:18:13 CET 2008


> I had the same problem and found a solution in some forums. Try this:
>
> p<-ggplot(data, aes(x,y,fill)) + geom_point() + scale_x_continuous("your
> xlabel") + scale_y_continuous("your ylabel")

The new (more ggplot-like way) is to do:

ggplot(data, aes(x,y,fill)) + ... + opts(title = "my title")

Hadley

--
http://had.co.nz/



More information about the R-help mailing list