Matrix: Draw distribution...

A command to draw the distribution histogram of the values in the selected part of a Matrix.

Settings

Horizontal range, Vertical range
determine the part of the matrix whose distribution will be drawn.
Minimum value, Maximum value
determine the range of values that will be considered in the distribution. To treat all bin widths equally, the range will include the Minimum value and exclude the Maximum value (see below).
Number of bins
determines the number of bars in the distribution histogram.
Minimum frequency, Maximum frequency
determine the limits of the vertical axis.

Algorithm

For a particular matrix element z, the histogram bin number i that will be incremented obeys the following relation:

lowerBinBorderiz < lowerBinBorderi+ binWidth,

where

binWidth = (maximumValue - minimumValue)/numberOfBins,

and

lowerBinBorderi = minimumValue + (i - 1)·binWidth.

In this way all bins will be based on exactly the same width, as each binning interval includes its lower border and excludes its upper border (i.e., each interval is closed to the left and open to the right).


© djmw, November 10, 2004