Re: [R] Histogram of multiple series on one histogram

From: Romain Francois <francoisromain_at_free.fr>
Date: Sat 04 Jun 2005 - 04:37:51 EST

Hello alexandre,

what you are trying to do is *not* an histogram (as a density estimator), if you divide each bar in 3, the surfaces of a won't sum to 1. However a barplot or a barplot2 (in package gplots, bundle gregmisc) would do the trick.
See graph 54 on the graph gallery :
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=54

BTW, don't call your vector 'c' unless you want funny things to happen

Romain

Le 03.06.2005 18:14, Depire Alexandre a écrit :

>Hello,
>I have three sample, for example
> a<-c(10,20,10,20,30)
> b<-c(10,20,20,30,30)
> c<-c(20,20,10)
>
>I would like to have only one histogram with these series,
>I try the following code:
> hist(a)
> hist(b,add=TRUE,col="red")
> hist(c,add=TRUE,col="green")
>but it's not that I want
>
>I would like an histogram with, from left to right, count of "10" for "a",
>count of "10" for "b", count of "10" for "c", count of "20" for "a", count of
>"20" for "b", ... not overlapped
>
>Thanks
>
>
>
>

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
~~~~~~      Romain FRANCOIS - http://addictedtor.free.fr         ~~~~~~
~~~~        Etudiant  ISUP - CS3 - Industrie et Services           ~~~~
~~                http://www.isup.cicrp.jussieu.fr/                  ~~
~~~~           Stagiaire INRIA Futurs - Equipe SELECT              ~~~~
~~~~~~   http://www.inria.fr/recherche/equipes/select.fr.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 Sat Jun 04 04:40:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:22 EST