Hi:
I am trying to add some caption at the bottom of the graphic by using the 
'xlab' and just adding a new line to it. Is there another way to do this or 
this is the correct way? Thanks

library(ggplot2)
library(effects)

df <- data.frame(
  x = c(3, 1, 5),
  y = c(2, 4, 6),
  label = c("a","b","c")
)
p <- ggplot(df, aes(x, y, label = label)) +
  xlab("X label\n\nThis graphic needs some caption here.\nIs there another way 
to add caption to graphics?") + ylab(NULL)
p + geom_point() + opts(title = "geom_point")


Felipe D. Carrillo  
Supervisory Fishery Biologist  
Department of the Interior  
US Fish & Wildlife Service  
California, USA

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to