Re: [R] superimposing histograms con't

From: Jeff Miller <jeffmiller_at_alphapoint05.net>
Date: Thu 29 Jun 2006 - 06:20:39 EST


I was just thinking about this last night.

I would like to do the same but WITH overlapping.

For example, I graph 2 sets of count data. Say the bars for the 1`s overlap...I would like to show that with a different shading for the group that has the higher frequency. For example, it could be black up to a frequency of 5 followed by diagonal-dashes from 5-7 representing the higher frequency of a second group.

Thank you,
Jeff Miller

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Bill Shipley Sent: Wednesday, June 28, 2006 3:54 PM
To: R help list
Subject: [R] superimposing histograms con't

Earlier, I posted the following question: I want to superimpose histograms from three populations onto the same graph, changing the shading of the bars for each population. After consulting the help files and the archives I cannot find out how to do this (seemly) simple graph. To be clear, I want
- a single x axis (from -3 to 18)

Gabor Grothendieck [ggrothendieck@gmail.com] pointed to some code to to this but I have found another way that works even easier.  

hist(x[sel1],xlim=c(a,b),ylim=c(A,B)) - this plots the histogram for the first group (indexed by sel1) but with an x axis and a y axis that spans the entire range.  

par(new=T) - to keep on the same graph  

hist(x[sel2],main=Null,xlab=NULL,ylab=NULL,axes=F) -superimposes the second histogram  

par(new=T) - to keep on the same graph  

hist(x[sel3],main=Null,xlab=NULL,ylab=NULL,axes=F) -superimposes the third histogram    

Bill Shipley

North American Editor, Annals of Botany

Editor, "Population and Community Biology" series, Springer Publishing

Dipartement de biologie, Universiti de Sherbrooke,

Sherbrooke (Quibec) J1K 2R1 CANADA

Bill.Shipley@USherbrooke.ca

http://callisto.si.usherb.ca:8080/bshipley/    

        [[alternative HTML version deleted]]



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 Thu Jun 29 06:44:42 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 30 Jun 2006 - 04:12:49 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.