histplot normalization is false in scilab 6.0.1
Reported by ROUX philippe
bug_histplot.png (11.44 KB, image/png)
histplot example from help
BUG DESCRIPTION:
----------------
histogram normalization is bugged with histplot
ERROR LOG:
----------
none
HOW TO REPRODUCE THE BUG:
-------------------------
lambda = 2;
X = grand(100000,1,"exp", 1/lambda);// exponential law sample
Xmax = max(X);
x=[0:0.2:Xmax]
clf()
F_obs=histplot(x, X, style=2)// histogram and observed frequency
plot2d(x,lambda*exp(-lambda*x),strf="000",style=5)// expected density
legend(["exponential random sample histogram" "exact density curve"]);
F_theo=exp(-lambda*x(1:$-1))-exp(-lambda*x(2:$))// theoretical frequencie
[F_obs;F_theo]' // approximately equals frequencies
// red curve and blue bars should be approximately the same
// observed and theoretical frequencies correspond so its a problem of normalization in histplot
OTHER INFORMATION:
------------------
see the figure in attachment, the figures in help pages are also showing the bug