# [ncl-talk] PDF plot changes with bin_nice and without.

Sri nandini bax8609 at uni-hamburg.de
Fri Jun 5 01:28:48 MDT 2020

```Hello ncl users,

I have a question on plotting my PDF, which changes (as it should) with
specific bin_nice and without.

Below is an example of my script, and the attached 2 plots, once with
using the bin_nice and one with using the bin_min and max.

I don't understand why bin space and values change, can some one help me
understand this?

Thanx Sri

~~~~~ snippet of the main PDF code~~~~

print("calculate PDFs...")
;; calculate empirical PDF

opt          = True
;opt at bin_min = -50.  (i have also tried it with 100,75..)
;opt at bin_max =  50.
opt at bin_nice=True
pdf1 = pdfx(hist_anom1, 100, opt)
printVarSummary(pdf1)
pdf2 = pdfx(rcp45_anom1, 100, opt)
printVarSummary(pdf2)
pdf3 = pdfx(rcp85_anom1,100, opt)
printVarSummary(pdf3)

;================================================================================
; prepare data for plotting
;================================================================================

nVar    = 3
nBin    = pdf1 at nbins          ; retrieve the number of bins

xx      = new ( (/nVar, nBin/), typeof(pdf1))

xx(0,:) = pdf1 at bin_center     ; assign appropriate "x" axis values
xx(1,:) = pdf2 at bin_center
xx(2,:) = pdf3 at bin_center

yy      = new ( (/nVar, nBin/), typeof(pdf1))
yy(0,:) = (/ pdf1 /) * 0.01 ;; convert % to absolut
yy(1,:) = (/ pdf2 /) * 0.01
yy(2,:) = (/ pdf3 /) * 0.01

~~~Than plotting~~~~~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hist_RCPs_detrednded_global_PDF_nicebins.pdf
Type: application/pdf
Size: 84214 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200605/9b7a2640/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hist_RCPs_detrended_global_PDF.pdf
Type: application/pdf
Size: 82867 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200605/9b7a2640/attachment-0001.pdf>
```

More information about the ncl-talk mailing list