+
Calculates an histogram of the vector y.
IN: y - fltarr vector
KEYWORDS: nbins - number of bins to be used (default is 10)
This value is ignored if binsize is provided.
binsize - size of the bin to use (otherwise chosen to span the
range of y with 10 elements)
x - vector with the centers of the intervals
used to calculate the histogram. An element of
y is included in bin i when
x(i)-binsize/2. <= y(i) < x(i)+binsize/2.
This array is internally created, unless forcex is set,
in which case the input array is adopted.
cum - when switched on, a cumulative distrib. is returned
ind - an optional array with the indices of the elements
in the input array in each bin (padded with -1s).
forcex -- set this keyword to impose an input x array,
otherwise x is internally created and replaces the input one.
Carlos Allende Prieto, UT, Sep 1999
, UT, April 2005, changed to use long integers
, A&M, October 2010, added cum keyword
, Radazul, June 2011, added nbins and ind keywords,
changed nbins default and allowed x to be an input
even if it doesn't contain all elements of y,
as long as x is equidistant, when setting xforce.