Hello Tom,
You want geom_tile - there are some examples at
http://had.co.nz/ggplot2/geom_tile.html
Hadley
> --
> 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
>
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
I played around with this a bit and came up with the following for the
given example:
df2 <- data.frame(a = rep(c("a","b","c"), each = 200),
b = c(rnorm(200, 1.25, .35),
rnorm(200, -.5, .15),
rnorm(200, 2, 1)))
ggplot(df2, aes(x = b, y = a)) +
stat_density(aes(fill = ..density..), geom = "tile") +
scale_fill_gradient(low = "gray75", high = "gray0",
limits = c(.05,3)) +
facet_grid(a ~ ., scales = 'free_y', space = 'free') +
opts(axis.text.y = theme_blank())
I like the concept of this graphic; I could see potential for it to
replace rug plots and even boxplots, particularly when the sample
sizes are large and the variable is continuous (at least in
principle). Someone should give serious consideration to creating a
geom for it :)
Cheers,
Dennis
I agree that it's better than rug/box plots, but I'm not sure it's
better than frequency polygons or histograms.
Hadley