[R] ggplot2 customizing

Ido M. Tamir tamir at imp.univie.ac.at
Thu Jul 5 10:44:46 CEST 2007

Dear all,

I know that ggplot2 documentation is coming along,
but at the moment I can't find how to do the following:
a) change the title of the legend
b) get rid of the closing line at the bottom of the 
density line.

I also observed that the density lines (after limiting the
x-scale) extend a little bit into the surrounding of the plot, 
which can be seen very strong when plotted as pdf.
They extend into the white space between the tick and the
plotting panel.

p <- ggplot(df, aes(x=distance))
p + stat_density(aes(colour=factor(mark),y=..scaled..), size=1, fill=FALSE) + 
scale_x_continuous(limits=c(0, 1e4)) + scale_y_continuous("scaled density")

thank you very much,

More information about the R-help mailing list