CellsClosed, ClassesClosed

Interpretation of the classes in histogram plots

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

CellsClosedOptionalLeft, or Right
ClassesClosed[[CellsClosed]]See below

Graphics Primitives

ObjectsDefault Values
plot::Histogram2d

CellsClosed, ClassesClosed: Right

Description

CellsClosed determines whether the classes used in a histogram are intepreted as semi-open intervals that are closed at the left or the right boundary.

The graphical primitive plot::Histogram2d tallies numerical data into cells (“classes”) that are defined by the attribute Cells = [a_1 .. b_1, a_2 .. b_2, dots]. By default, these classes are interpreted as a collection of semi-open intervals that are closed at the right boundary. A data item x is tallied into the i-th cell if it satisfies ai < x ≤ bi. With the option CellsClosed = Left or the equivalent ClassesClosed = Left the classes are interpreted as the semi-open intervals that are closed at the left boundary.

Examples

Example 1

We create a sample of 15 data points:

data := [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]:

These data are to be tallied into the following cells (classes):

cells := [0 .. 1, 1 .. 2, 2 .. 3, 3 .. 4, 4 .. 5, 5 .. 6]:

With the default setting CellsClosed = Right, the 6 classes are the intervals , etc. The interval contains one of the data items, the interval contains two, etc.:

plot(plot::Histogram2d(data, Cells = cells))

Using CellsClosed = Left, the 6 classes are interpreted as the intervals , etc. Now, the first class contains none of the data items, the second class contains one item, etc.:

plot(plot::Histogram2d(data, Cells = cells, CellsClosed = Left))

delete data, cells:

See Also

MuPAD Functions