ggplot(data.frame(x = rnorm(1000)), aes(x = x)) +
geom_histogram(aes(fill = x < 0 )) + geom_vline(xintercept=0) +
scale_fill_manual(values = c("black","grey20"))
Charlotte
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
Think you can obtain the result you want easily using stat_bin options,
Hope this helps,
fernando
x= rnorm(1000)
ggplot(data.frame(x), aes(x = x)) +
geom_histogram(aes(fill = x < 1), origin = -5, binwidth = 0.25) +
geom_vline(xintercept=1) +
scale_fill_manual(values = c("red4","blue4"))
-----Mensaje original-----
De: ggp...@googlegroups.com [mailto:ggp...@googlegroups.com] En nombre de
Cedric Ginestet
Enviado el: viernes, 18 de junio de 2010 10:53
Para: ggplot2
Asunto: Re: Filling only one part of a histogram.