Two dimensional histograms are defined by the following struct,
size_t nx, ny
double * xrange
double * yrange
double * bin
bin(i,j)
= bin[i * ny + j]
.
The range for bin(i,j)
is given by xrange[i]
to
xrange[i+1]
in the x-direction and yrange[j]
to
yrange[j+1]
in the y-direction. Each bin is inclusive at the lower
end and exclusive at the upper end. Mathematically this means that the
bins are defined by the following inequality,
Note that any samples which fall on the upper sides of the histogram are excluded. If you want to include these values for the side bins you will need to add an extra row or column to your histogram.
The gsl_histogram2d
struct and its associated functions are
defined in the header file `gsl_histogram2d.h'.