Re: [R] plotting horizontally

From: Marc Schwartz (via MN) <mschwartz_at_mn.rr.com>
Date: Wed 27 Jul 2005 - 05:47:43 EST

On Tue, 2005-07-26 at 08:58 +0700, dkf@specere.com wrote:
> Hello,
>
> Is there any way to use plot() horizontally similar to
> boxplot(....., horiz=TRUE)? I want to use to illustrate
> the distribution of y-values on an adjacent plot using
> layout().
>
> Thanks in advance for any help.
>
> Regards,
>
> --Dan

Have you looked at the last example in ?layout, which has a scatterplot with marginal histograms for the x and y axes?

Alternatively, you can generally reverse the x and y values for most plots. For example, compare:

 d <- density(rnorm(100))

 # Vertical density plot
 plot(d)

 # Horizontal density plot
 plot(d$y, d$x, type = "l", xlab = "Density",

      main = "density(y = rnorm(100))",
      ylab = paste("N =", d$n, "  Bandwidth =", formatC(d$bw)))


HTH, Marc Schwartz



R-help@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 Received on Wed Jul 27 05:53:08 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:34:01 EST