On Jan 25, 2008 2:04 PM, Domenico Vistocco <[EMAIL PROTECTED]> wrote: > You could use ggplot2: > > library(ggplot2) > x=rnorm(100) > y=rnorm(100) > df=melt(data.frame(x,y)) > #for "vertical" histogram > ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable) > #for "horizontal" histogram > ggplot(data=df,aes(x=value))+geom_histogram()+facet_grid(.~variable) + > coord_flip()
And it's moderately easy to create a back-to-back histogram too: qplot(x, geom="histogram", fill="x", binwidth=0.5) + geom_histogram(data=data.frame(x=y), aes(fill="y", y=-..count..), binwidth= 0.5) + scale_fill_hue("variable") Hadley -- 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.