Re: [R] Multiple histograms in one chart

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Mon 14 Mar 2005 - 12:42:32 EST

If you use par(new=TRUE), you are overlaying one graph on top of the other. In which case, make sure your xlim and ylim are correctly set.

Another way is to split the plotting window. For example

   par(mfrow=c(2,3))
   for(i in 1:6) hist( rnorm(100), main=paste("Histogram", i))

See help("par") for more info.

Regards, Adai

On Sun, 2005-03-13 at 15:15 +0100, Uwe Ligges wrote:
> Werner Wernersen wrote:
> > Hi!
> >
> > I've searched quite a while and this is probably a
> > very easy question: How do I
> > prevent a new hist() histogram from clearing the chart
> > window before drawing?
> >
> > I would like to have several histograms simply drawn
> > on each other in one chart...
>
> See either ?par
> par(new=TRUE)
> or try argument add = TRUE in hist, depending on what you want to do
> exactly.
>
> Uwe Ligges
>
>
> > Thanks for your help!
> > Werner
> >
> > In use: win2ksp4 & R 2.0.1
> >
> > ______________________________________________
> > 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
>
> ______________________________________________
> 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
>



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 Mon Mar 14 12:45:58 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:47 EST