Hi, small modifications to your code will do the trick
> Here everything is ok, except few points : > 1. I want to remove the name of y-axis, which is by default "density". Here > I put ylab(""), however although for x-axis it is working, for y-axis it is > not. Is there any specific formula for that? use scale_y_continuous('') instead of ylab > > 2. I want to rename the color plot, as well as the title of the color. The > function scale_colour_manual() seems not working. Can anyone please suggest > me how to achieve desired thing? use scale_fill_discrete() # new code, everything 's ok library(ggplot2); library(plyr) dat <- cbind(rnorm(300), rep(c(1,2), each=150)) ggplot() + geom_density(aes(x=dat[,1], fill=factor(dat[,2]), position="stack")) + xlab("") + scale_y_continuous("") + scale_fill_discrete(name = "Pallet", labels = c("X", "Y")) Regards, Matthieu ______________________________________________ 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.