# Histograms

This chapter describes functions for creating histograms. Histograms provide a convenient way of summarizing the distribution of a set of data. A histogram consists of a set of bins which count the number of events falling into a given range of a continuous variable x. In GSL the bins of a histogram contain floating-point numbers, so they can be used to record both integer and non-integer distributions. The bins can use arbitrary sets of ranges (uniformly spaced bins are the default). Both one and two-dimensional histograms are supported.

Once a histogram has been created it can also be converted into a probability distribution function. The library provides efficient routines for selecting random samples from probability distributions. This can be useful for generating simulations based real data.

The functions are declared in the header files ``gsl_histogram.h'` and ``gsl_histogram2d.h'`.

- The histogram struct
- Histogram allocation
- Copying Histograms
- Updating and accessing histogram elements
- Searching histogram ranges
- Histogram Statistics
- Histogram Operations
- Reading and writing histograms
- Resampling from histograms
- The histogram probability distribution struct
- Example programs for histograms
- Two dimensional histograms
- The 2D histogram struct
- 2D Histogram allocation
- Copying 2D Histograms
- Updating and accessing 2D histogram elements
- Searching 2D histogram ranges
- 2D Histogram Statistics
- 2D Histogram Operations
- Reading and writing 2D histograms
- Resampling from 2D histograms
- Example programs for 2D histograms