8.2 histogram2d -- 2-dimensional histograms

class histogram2d( long size x, long size y | histogram2d h)
This class holds a 2d array and 2 sets of ranges for x and y coordinates for a two paramter statistical event. It can be constructed by size parameters or as a copy from another histogram. Most of the methods are the same as of histogram.

set_ranges_uniform( float xmin, float xmax, float ymin, float ymax)
set the ranges to uniform distance, returns None
alloc( long nx, long ny)
allocate necessary space, returns None
reset( )
sets all bin values to 0, returns None
increment( float x, float y)
increments corresponding bin, returns None
accumulate( float x, float y, float weight)
adds the weight to corresponding bin, returns None
xmax( )
returns upper x range as float
xmin( )
returns lower x range as float
ymax( )
returns upper y range as float
ymin( )
returns lower y range as float
nx( )
returns number of x bins as long
ny( )
returns number of y bins as long
get( long i, long j)
gets value of indexed bin,returns float
get_xrange( long i)
gets upper and lower x range of indexed bin, returns (float lower, float upper)
get_yrange( long j)
gets upper and lower y range of indexed bin, returns (float lower, float upper)
find( float x, float y)
finds index pair of corresponding value pair, returns (long,long)
max_val( )
returns maximal bin value as float
max_bin( )
returns bin index with maximal value as long
min_val( )
returns minimal bin value as float
min_bin( )
returns bin index with minimal value as long
sum( )
returns sum of bin values as float
xmean( )
returns x mean of histogram as float
xsigma( )
returns x std deviation of histogram as float
ymean( )
returns y mean of histogram asfloat
ysigma( )
returns y std deviation of histogram as float
cov( )
returns covariance of histogram as float
set_ranges( sequence xranges, sequence yranges)
set the ranges according to given sequences, returns None
shift( float offset)
shifts the contents of the bins by the given offset, returns None
scale( float scale)
multiplies the contents of the bins by the given scale, returns None
equal_bins_p( )
true if the all of the individual bin ranges are identical, returns int
add( histogram2d h)
adds the contents of the bins, returns None
sub( histogram2d h)
substracts the contents of the bins, returns None
mul( histogram2d h)
multiplicates the contents of the bins, returns None
div( histogram2d h)
divides the contents of the bins, returns None
clone( )
returns a copy instance of histogram2d
copy( histogram2d h)
copies the given histogram to myself, returns None
read( file input)
reads histogram binary data from file, returns None
writew( file output)
writes histogram binary data to file, returns None
scanf( file input)
reads histogram data from file using scanf, returns None
printf( file input)
writes histogram data to file using printf, returns None

Some mapping operations are supported, too:

Mapping syntax Effect
histogram[x_index,y_index] returns the value of the indexed bin
histogram[x_index,y_index]=value sets the value of the indexed bin
len(histogram) returns the size of the histogram, i.e nx$ \times$ ny

See Also:

For the special meaning and details please consult the GNU Scientific Library reference.