Histograms

### 19.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 19.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:

- histogram takes one mandatory argument and one optional argument:
  - L, a list whose elements are lists of a range a..b and a positive integer.
  - Optionally, color=col, where col is a color object (see Section 18.1.3).
- histogram(L ⟨,color=col ⟩) draws a histogram for the data. If col is provided, then the fill color is changed from grey to col.

#### Example

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

With unsorted data:

- histogram takes one mandatory argument and two optional arguments.
  - L, a list of numbers.
  - Optionally, a and b, numbers.
  - Optionally, color=col, where col is a color object (see Section 18.1.3).
- histogram(L ⟨,a,b⟩ ⟨,color=col ⟩) returns the histogram for classes(L ⟨,a,b⟩) (see Section 19.1.9). If col is given, then the fill color is changed from grey to col.

#### Example

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