Here I have following code : dat = rnorm(100) ggplot() + geom_histogram(aes(dat, fill=..count..)) + scale_fill_gradient("Count", low="green", high="red") + opts(legend.position="none") # Above is without any legend
## Now I want to place two points with legends dat1 <- data.frame(c(0,0), c(1,0)); Label <- c("Point1", "Point2") last_plot() + geom_point(aes(dat1[,1], dat1[,2], colour=Label), size=4) # Here I am not getting any legend for "points" I want GGPLOT should show the legend for "points" NOT for "histogram". Is there any option? Thanks, -- View this message in context: http://n4.nabble.com/GGPLOT-Legends-at-different-layers-tp954527p954527.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.