Plot a histogram
histo(x) histo(x) histo(x,n) histo(x,n) histo(x,n,scale) histo(x,n,scale,sym) h=histo(...) [h,edge]=histo(...)
a 1-by-p or p-by-1 matrix of doubles, the data
a 1-by-1 matrix of doubles, the approximate number of bins (default n = ceil(log2(p)+1), where p is the size of x. This is Sturges' rule.). If n is not a scalar, it contains the edges of the classes, in increasing order.
a boolean, set to %t to have the area 1 under the histogram instead of area n. (default scale = %f means no scaling)
a 1-by-1 matrix of doubles or string, the integer (positive or negative) of the color of the plot (default sym=[]). Negative is for a mark, positive is for a color.
a 1-by-(n+1) matrix of doubles, the edges of the classes of the histogram
a 1-by-n matrix of doubles, h(i) is the number of values in x that belong to [edge(i), edge(i+1)[
Compute and plots a histogram of the x.
Any input argument equal to the empty matrix is replaced by its default value.
The advantage of the stixbox/histo function over the Scilab/histplot function is that the number of classes n can be automatically computed in histo, while it is the first argument of histplot.
x=distfun_chi2rnd(3,1000,1); scf(); histo(x); xtitle("Chi-Square random numbers","X","Frequency") // Set the number of classes scf(); histo(x,10); // Set the edges scf(); X=distfun_unifrnd(0,1,1000,1); edges = 0:0.2:1.; histo(X,edges); // See without scaling scf(); histo(x,[],%f); // See with scaling scf(); histo(x,[],%t); // See various colors and styles scf(); histo(x,[],[],1); scf(); histo(x,[],[],2); scf(); histo(x,[],[],3); | ![]() | ![]() |