Histogram Command
From GeoGebra Manual
- Histogram[<List of Class Boundaries>, <List of Heights>]
- Creates a histogram with bars of the given heights. The class boundaries determine the width and position of each bar of the histogram.
Example:
Histogram[{0, 1, 2, 3, 4, 5}, {2, 6, 8, 3, 1}]
creates a histogram with 5 bars of the given heights. The first bar is positioned at the interval [0, 1], the second bar is positioned at the interval [1, 2], and so on.
- Histogram[<List of Class Boundaries>, <List of Raw Data>, <Boolean Use Density>, <Density Scale Factor>(optional)]
- Creates a histogram using the raw data. The class boundaries determine the width and position of each bar of the histogram and are used to determine how many data elements lie in each class. Bar height is determined as follows
- If Use Density = true, height = (Density Scale Factor) * (class frequency) / (class width)
- If Use Density = false, height = class frequency
- By default, Use Density = true and Density Scale Factor = 1. This creates a histogram with total area = n, the number of data values.
Example: (Default Histogram)
Histogram[{10, 20, 30, 40}, {10, 11, 11, 12, 18, 20, 25, 40}, true]
creates a histogram with 3 bars, with the heights 0.5 (first bar), 0.2 (second bar), and 0.1 (third bar).
Example: (Count Histogram)
Histogram[{10, 20, 30, 40}, {10, 11, 11, 12, 18, 20, 25, 40}, false]
creates a histogram with 3 bars, with the heights 5 (first bar), 2 (second bar), and 1 (third bar). This histogram does not use density scaling and gives bar heights that equal the count of values in each class.
Example: (Normalized Histogram)
Histogram[{10, 20, 30, 40}, {10, 11, 11, 12, 18, 20, 25, 40}, true, 1/8]
creates a histogram with 3 bars, with the heights .0625 (first bar), .025 (second bar), and .0125 (third bar).
This histogram has total area = .0625*10 + .025*10 + .0125*10 = 1.
- Histogram[ <Boolean Cumulative>, <List of Class Boundaries>, <List of Raw Data>, <Boolean Use Density> , <Density Scale Factor> (optional) ]
- If Cumulative is true this creates a histogram where each bar height equals the frequency of the class plus the sum of all previous frequencies.
Example: :
Histogram[true, {10, 20, 30, 40}, {10, 11, 11, 12, 18, 20, 25, 40}, true]
creates a histogram with 3 bars, with the heights 5 (first bar), 7 (second bar), and 8 (third bar).