Plot a histogram
[h,edge]=histo(x) [h,edge]=histo(x,n) [h,edge]=histo(x,n,odd) [h,edge]=histo(x,n,odd,scale) [h,edge]=histo(x,n,odd,scale,sym)
datas
approximate number of bins (default n = ceil(4*sqrt(sqrt(size(x,'*')))) )
set to 0 or 1 for placement of bins. Least significant digit of bin width will always be 1, 2 or 5. (default odd = 0)
set to 1 to have the area 1 under the histogram instead of area n. (default scale = 0 means no scaling)
the integer (positive or negative) of the color of the plot. Negative is for a mark, positive is for a color.
edges of the classes of the histogram
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 odd variable allows to configure the edges of the histogram.
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(); [h,edge]=histo(x); // Sets the approximate number of classes scf(); histo(x,10); // See how the edges moves when we configure the odd argument scf(); histo(x,[],1); scf(); histo(x,[],10); scf(); histo(x,[],100); // See without scaling scf(); histo(x,[],[],0); // See with scaling scf(); histo(x,[],[],1); // See various colors and styles scf(); histo(x,[],[],[],1); scf(); histo(x,[],[],[],2); scf(); histo(x,[],[],[],3); | ![]() | ![]() |