File: The-2D-histogram-struct.html

package info (click to toggle)
gsl-ref-html 2.3-1
• area: non-free
• in suites: bullseye, buster, sid
• size: 6,876 kB
• ctags: 4,574
• sloc: makefile: 35
 file content (120 lines) | stat: -rw-r--r-- 5,648 bytes parent folder | download
 `123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120` `````` GNU Scientific Library – Reference Manual: The 2D histogram struct

23.13 The 2D histogram struct

Two dimensional histograms are defined by the following struct,

Data Type: gsl_histogram2d
size_t nx, ny

This is the number of histogram bins in the x and y directions.

double * xrange

The ranges of the bins in the x-direction are stored in an array of nx + 1 elements pointed to by xrange.

double * yrange

The ranges of the bins in the y-direction are stored in an array of ny + 1 elements pointed to by yrange.

double * bin

The counts for each bin are stored in an array pointed to by bin. The bins are floating-point numbers, so you can increment them by non-integer values if necessary. The array bin stores the two dimensional array of bins in a single block of memory according to the mapping 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,

bin(i,j) corresponds to xrange[i] <= x < xrange[i+1]                     and yrange[j] <= y < yrange[j+1]

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.

``````