[ncl-talk] NCL PDF calculate automatic bins

Sri nandini bax8609 at uni-hamburg.de
Wed Sep 23 04:54:46 MDT 2020


Hello dear NCL-users,

I am trying to find the correct method for calculating automatic number 
of bins per different data sets, in order to plot them together.

I have the following script, there is no error, but the PDFs looks very 
ragged because the bins are more than 25. How can i smooth the PDF curve?

Since i want the data to have bin width of 0.5 for all, i calculated 
different bin sizes. My plot is also attached here.

    opt = True
    opt at bin_spacing = 0.5
    max_ws = max(hist_anom1)
    printMinMax(max_ws,True)
    min_ws= min(hist_anom1)
    printMinMax(min_ws,True)

    nbins1 = floattointeger(((max_ws - min_ws)/0.5)+1)
    print(nbins1) ====>79

    max_ws1 = max(rcp45_anom1)
    min_ws1= min(rcp45_anom1)
    nbins2 = floattointeger(((max_ws1 - min_ws1)/0.5)+1)
    print(nbins2) ====>81

    max_ws2 = max(rcp85_anom1)
    min_ws2= min(rcp85_anom1)
    nbins3 = floattointeger(((max_ws2 - min_ws2)/0.5)+1)
    print(nbins3) ====>83


Best

Sri


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Monthly_new_NY_PDFs.pdf
Type: application/pdf
Size: 90410 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200923/e688e167/attachment.pdf>


More information about the ncl-talk mailing list