[R] Normalized Y-axis for Histogram Density Plot

Gundala Viswanath gundalav at gmail.com
Wed Sep 2 06:16:37 CEST 2009


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.




More information about the R-help mailing list