Histogramdivides the region of values betweenxminandxmaxintonequal intervals and counts the number of elements in the arrayAwhose values lie in each interval. If a value inAlies belowxminor at or abovexmax, it is not counted. If a value is exactly the value that separates two intervals, it is counted in the higher of the two intervals.
Histogramcounts in the following manner: Letsbe the width of an interval in which values are counted.Sis defined by the expression
If a value inAfalls betweenxmin, inclusive, andxmin+s, exclusive, the count in the first element ofHistis increased. If the value falls betweenxmin+s, inclusive, andxmin+2s, exclusive, the count in the second element ofHistis increased, etc.
Histmust contain at leastnelements.
Errors
Histogramcauses an HTBasic error if its arguments are not of the types listed in the USAGE section, above, ifxminxmax, ifnis negative or zero, or ifHistcontains fewer thannelements.