Previous Up Next

20.1.10  Histograms

Given a list of intervals and a number of points in each interval, such as is given by the output of the classes command (see Section 20.1.9), a histogram is a graph consisting of a box over each interval, where the height of each box is proportional to the number of points and the total area of the boxes is 1. The histogram or histogramme command draws histograms. Data does not have to be sorted.

With sorted data:

Example

histogram([[0,1],[1,4],[2,3],[3,2],[4,1]])

With unsorted data:

Example

histogram([1,2,2.5,2.5,3],0.5,0.75,color=brown)

Previous Up Next