begin dbz_data = random_uniform(-9,60,100) wks = gsn_open_wks("x11","histo_mod") res = True res@gsnMaximize = True res@tiMainString = "Let NCL pick the bin intervals" plot = gsn_histogram(wks,dbz_data,res) print(plot) ; this prints everything attached to plot print(plot@BinLocs) ; the actual bin ranges used ;---Set the intervals ourselves int_radar = ispan(-9,60,3) res@gsnHistogramBinIntervals = int_radar res@tiMainString = "Explicitly set bin intervals yourself" res@tmXBLabelFontHeightF = 0.01 ; make labels smaller plot = gsn_histogram(wks,dbz_data,res) delete(res@gsnHistogramBinIntervals) print(plot) ; this prints everything attached to plot print(plot@BinLocs) ; the actual bin ranges used ; ; Convert float data to integer data so we are sure to have some ; values exactly equal to -9, -8, ..., 60. Note that not ; every discrete bin will have values exactly equal, because this ; is random! ; idbz_data = toint(dbz_data) res@gsnHistogramDiscreteBinValues = int_radar res@tiMainString = "Explicitly set discrete bin values" plot = gsn_histogram(wks,idbz_data,res) end