[R] Odp: Normalized Y-axis for Histogram Density Plot

Petr PIKAL petr.pikal at precheza.cz
Wed Sep 2 09:37:00 CEST 2009


Hi

that is a question which comes almost so often as "why R does not think 
that my numbers are equal". So even I, non statistician, can deduct that 
hist with probability =T can have any y axis range but the sum below curve 
has to be below 1.

Regards
Petr

r-help-bounces at r-project.org napsal dne 02.09.2009 06:16:37:

> I have the following data which I tried to draw
> the probability density plot.
> 
> Here is the code I have:
> 
> x <- read.table("mydat.txt");
> d <- rep(x$V2,times=x$V3);
> hist(d,probability=T, xlab="FlowSignal");
> 
> But why the y-axis range from 0 to 6,
> instead of 0 to 1?  What's the correct way to plot it?
> 
> 
> #id  flowsignal frequency
> 1       0.67    1
> 1       0.70    1
> 1       0.75    1
> 1       0.78    2
> 1       0.79    1
> 1       0.83    1
> 1       0.84    3
> 1       0.85    3
> 1       0.86    1
> 1       0.88    1
> 1       0.89    1
> 1       0.91    1
> 1       0.93    1
> 1       0.94    1
> 1       0.96    2
> 1       0.98    4
> 1       0.99    2
> 1       1.00    2
> 1       1.01    1
> 1       1.02    5
> 1       1.04    3
> 1       1.05    5
> 1       1.06    5
> 1       1.07    4
> 1       1.08    7
> 1       1.09    6
> 1       1.10    2
> 1       1.11    2
> 1       1.14    1
> 1       1.15    1
> 1       1.17    1
> 1       1.20    1
> 1       1.21    1
> #end of data
> 
> 
> Regard,
> G.V.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list