Skip to content
Prev 248231 / 398506 Next

ggplot2 - ribbon

On 1/24/2011 7:44 AM, Sam wrote:
To see what is happening, a simple toy example works; the details of 
your specific graph aren't needed.

p <- ggplot(mtcars, aes(x=carb, y=mpg)) + geom_point()

p + stat_summary(geom="ribbon", fun.ymin="min", fun.ymax="max")

p + stat_summary(geom="ribbon", fun.ymin="min", fun.ymax="max",
	alpha=0.2, fill="blue")

You can set the transparency (alpha) of the fill and the color of the 
fill (fill) to whatever you want.  You can also set the color of the 
lines around the fill with colour. As fixed (not data determined) 
values, they are not inside an aes call.