[R] Switching X-axis and Y-axis for histogram

hadley wickham h.wickham at gmail.com
Fri Jun 22 21:13:09 CEST 2007


It's trivial to do this with ggplot2 (http://had.co.nz):

qplot(rating, data=movies, geom="histogram") + coord_flip()
qplot(rating, data=movies, geom="histogram", binwidth=0.1) + coord_flip()

Hadley

On 6/22/07, Donghui Feng <donghui.feng at gmail.com> wrote:
> Dear all,
>
> I'm creating a histogram with the function hist(). But
> right now what I get is column representation (as normal).
> I'm wondering if I could switch X-axis and Y-axis and
> get row-representation of frequencies?
>
> One more question, can I define the step of each axises
> for the histogram?
>
> Thanks so much!
>
> Donghui
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list