>  Now I think I understand want you want. I'm affraid that won't be easy
>  because you're trying to mix continuous variables with categorical ones
>  on the same scale. A density plot has two continuous scales: VALUE and
>  it's density. The boxplot has a continuous scale (VALUE) and the other
>  is categorical. Maybe Hadley knows a solution for your problem.

Well one idea is:

ggplot(diamonds, aes(x = price)) + geom_density(aes(min =
-..density.., adjust= 0.5),fill="grey50", colour=NA) + facet_grid(. ~
cut) + coord_flip()

which looks like it would naturally fit with a boxplot overlaid on top
of it.  However, it's currently not possible because the boxplot is
parameterised so that it is always horizontal, while the density is
vertical - in the above example I have flipped the coordinate system,
but that flips both density plot and boxplot.

Hadly

-- 
http://had.co.nz/

______________________________________________
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.

Reply via email to