[ncl-talk] PDF plot changes with bin_nice and without.
Dennis Shea
shea at ucar.edu
Mon Jun 8 14:52:14 MDT 2020
Perhaps, looking at the 'pdfx' function code will help:
%> less "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
---
Or, you could extract the code and rename the function and add some print
statements.
---
I wrote this function but, currently, I do not have the time to look.
Good Luck
Stay Healthy
On Mon, Jun 8, 2020 at 4:05 AM Sri nandini via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:
> Could someone please advice me on the following?
> On 05.06.20 09:28, Sri nandini via ncl-talk wrote:
>
> 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~~~~~
>
>
>
> _______________________________________________
> ncl-talk mailing listncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200608/88a9fc39/attachment.html>
More information about the ncl-talk
mailing list