<< Graphics Graphics identify >>

Stixbox >> Stixbox > Graphics > histo

histo

Plot a histogram

Calling Sequence

[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)

Parameters

x :

datas

n :

approximate number of bins (default n = ceil(4*sqrt(sqrt(size(x,'*')))) )

odd :

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)

scale :

set to 1 to have the area 1 under the histogram instead of area n. (default scale = 0 means no scaling)

sym :

the integer (positive or negative) of the color of the plot. Negative is for a mark, positive is for a color.

egde :

edges of the classes of the histogram

h :

h(i) is the number of values in x that belong to [edge(i), edge(i+1)[

Description

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.

Examples

x = rchisq(1000,3);
scf();
[h,edge]=histo(x);

// Sets the approximate number of classes
clf();
histo(x,10);

// See how the edges moves when we configure the odd argument
clf(); histo(x,[],1);
clf(); histo(x,[],10);
clf(); histo(x,[],100);

// See without scaling
clf(); histo(x,[],[],0);
// See with scaling
clf(); histo(x,[],[],1);

// See various colors and styles
clf();histo(x,[],[],[],1);
clf();histo(x,[],[],[],2);
clf();histo(x,[],[],[],3);

Authors


Report an issue
<< Graphics Graphics identify >>