next up previous index
Next: L210 COMIS - Up: CERNLIB Previous: J403 Print Banner

J530 Reasonable Intervals for Histogram Binning

Routine ID: J530
Author(s): F. JamesLibrary: KERNLIB
Submitter: Submitted: 01.10.1974
Language: FortranRevised:

BINSIZ determines reasonable lower and upper limits and bin width for a histogram, given the lower and upper limits of the data and the desired maximum number of bins. The output bin width is always an integral power of 10 x1, 2, 2.5 or 5, and the output lower and upper limits are the nearest multiples of the bin width containing the specified range. Another option allows the bin width to be imposed and determines only the new limits.

Structure:

SUBROUTINE subprogram
User Entry Names: BINSIZ

Usage:

    CALL BINSIZ(AL,AH,NA,BL,BH,NB,BWID)
AL
( REAL) Lower limit of data to be histogrammed.
AH
( REAL) Upper limit of data to be histogrammed.
NA
( INTEGER) Maximum number of bins desired.
BL
( REAL) Lower limit determined by BINSIZ (BL ≤AL) .
BH
( REAL) Upper limit determined by BINSIZ (BH ≥AH) .
NB
( INTEGER) Number of bins determined by BINSIZ (NA/2 < NB ≤NA) .
BWID
( REAL) Bin width (BH-BL)/NB .
If NA=0 or NA=-1 , BINSIZ always makes exactly one bin.

If NA = 1 , BINSIZ takes BWID as input and determines only BL, BH, and NB. This is especially useful when it is desired to have the same bin width for several histograms (or for the two axes of a scatter-plot).

If AL>AH , BINSIZ takes AL to be the upper limit and AH to be the lower limit, so that in fact AL and AH may appear in any order. They are not changed by BINSIZ. If AL = AH , BINSIZ takes the lower limit as AL, and the upper limit is set to AL+1 .

Executive Routines

L210



next up previous index
Next: L210 COMIS - Up: CERNLIB Previous: J403 Print Banner


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995