Inform me () when using this script or encorporating it in a library.
Source code of hist.pro:
;+
; NAME:
; HIST
; PURPOSE:
; Wrapper for the IDL HISTOGRAM routine, which has the option of
; giving back the bins. The bins returned are in the central
; values of the bin, not the edges. If too many parameters are
; given and they are conflicting, then the parameters are used
; in the order of importance, min, binsize, nbins, max
; CALLING SEQUENCE:
;
; EXAMPLES:
;
; KEYWORDS:
;
; MODIFICATION HISTORY:
; 04/03/05 Written by Eduard Westra
;-
FUNCTION hist, data, min=min, max=max, binsize=binsize, rbins=rbins, help=help, double=double
IF (KEYWORD_SET(HELP)) THEN BEGIN & doc_library,'hist' & RETURN, -1 & ENDIF
IF (~(N_ELEMENTS(min) EQ 1 AND N_ELEMENTS(max) EQ 1 AND N_ELEMENTS(binsize) EQ 1)) THEN BEGIN
doc_library,'hist' & RETURN, -1
ENDIF
result = HISTOGRAM(data, min=min-0.5*binsize, max=max, binsize=binsize)
rbins = FINDGEN(N_ELEMENTS(result))*binsize + min
RETURN, (KEYWORD_SET(double) ? DOUBLE(result) : result)
END