idlastro / Robust Statistics procedures: AUTOHIST

[Source code]

NAME
AUTOHIST
PURPOSE
Draw a histogram using automatic bin-sizing.
EXPLANATION
AUTOHIST chooses a number of bins (initially, SQRT(2*N). If this leads 
to a histogram in which > 1/5 of the central 50% of the bins are empty,
it decreases the number of bins and tries again. The minimum # bins is 
5. The max=199.     Called by HISTOGAUSS and HALFAGAUSS.
CALLING SEQUENCE
AUTOHIST, Sample, XLines, Ylines, XCenters, YCenters, [/NOPLOT, ]
                      ...Plotting Keywords
INPUT
Sample = the vector to be histogrammed
OUTPUT
XLINES = vector of x coordinates of the points that trace the rectangular 
        histogram bins
YLINES = vector of y coordinates. To draw the histogram plot YLINES vs 
          XLINES
XCENTERS = the x values of the bin centers
YCENTERS = the corresponding y values
OPTIONAL INPUT KEYWORDS
/NOPLOT  If set, nothing is drawn
Any plotting keywords (e.g. XTITLE) may be supplied to AUTOHIST through
the _EXTRA facility. 
REVISION HISTORY
Written,   H. Freudenreich, STX, 1/91
1998 March 17 - Changed shading of histogram.  RSH, RSTX
V5.0 update, _EXTRA keywords  W. Landsman    April 2002
Added NOCLIP keyword for POLYFILL call C. Paxson/W. Landsman July 2003
Use Coyote graphics   W. Landsman  Feb 2011