[R] difficulies with boxplot

Emmanuel Paradis paradis at isem.univ-montp2.fr
Thu Aug 23 12:12:14 CEST 2001


At 09:43 23/08/01 +0200, you wrote:
>Dear list,
>
>sorry for bothering you with a probably simple question... I searched
>the archive but couldn't find the right answer.
>
>I have computed  upper and lower bounds of  a region and would like to
>plot them in a boxplot. My problem is now to get the two boxplots in the
>same graphic so that the boxplot of the upper bounds is directly on top
>of the boxplot of the lower bounds. The reason I don't want to have them
>next to each other is that I have another  "grouping" variable. I tried
>"add" but didn't succeed.
>
>I'm using R 0.64.2 on Windows NT.

You should definitely install R-1.3.0!

For your problem, I suggest you set par(new=TRUE) after drawing your first
plot; for instance:

> x <- rnorm(40)
> y <- rnorm(40, mean=5)
> ff <- gl(2, 20)
> boxplot(x ~ ff, ylim=c(-3, 8))
> par(new=TRUE)
> boxplot(y ~ ff, ylim=c(-3, 8), axes=FALSE)

taking care to set ylim the same in both calls of boxplot().

Emmanuel Paradis

>Thanks for your help,
>Nina Lieske
>
>--
>Das Recht auf Dummheit gehört zur Garantie der freien Entfaltung der
>Persönlichkeit. [Mark Twain]
>
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
.-.-
>r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
>Send "info", "help", or "[un]subscribe"
>(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
._._
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list