<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi</p>
<p>I have some code which you may be able to use with some
modification. The array xval has the x coordinates you are
plotting. <br>
</p>
<p>undef("calcnorm")<br>
function calcnorm (xAve,xStd,x)<br>
local zero,one,pi,xAve,xStd,x,nor,xVar,con<br>
begin<br>
; normal(xAve,xStd) =
[1/sqrt(2*pi)]*exp[-(0.5*(x-xAve)^2/xStd^2)<br>
zero = 0.0d<br>
one = 1.0d<br>
pi = 4.0d*atan(1.0d)<br>
con = one/(sqrt(2*pi))<br>
xVar = xStd^2<br>
nor = con*exp(-(((x-xAve)^2)/(2*xVar)) )<br>
return(nor)<br>
end<br>
<br>
</p>
Called with<br>
zNorm = calcnorm(0., 1.,xval)<br>
<br>
You may need to normalize the resulting values when plotting. I
then put the 2 arrays into one data array<br>
<b> datatest = new((/2,nsgs/),double)<br>
<br>
datatest(0,:)=yvaldata<br>
datatest(1,:)=zNorm*xbin<br>
</b> xy_plot = gsn_csm_xy (wks,xval,datatest,xyres) <br>
<br>
Cathy Smith<br>
<br>
<div class="moz-cite-prefix">On 3/2/18 9:27 AM, Xi Chang wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGfRhtcYsJRwWyBX3buRxPW4zfuo5mFViEmYdBCfm2e=h0PZNw@mail.gmail.com">
<div dir="ltr">Dear NCL,
<div><br>
</div>
<div>I'd like to plot PDF distribution using this function
"pdfx" but superimposed with a Gaussian fit line of
this distribution? Any example for this?</div>
<div><br>
</div>
<div>Best,</div>
<div>Chang </div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
----------------------------------------------
NOAA/ESRL PSD and CU CIRES
303-497-6263
<a class="moz-txt-link-freetext" href="http://www.esrl.noaa.gov/psd/people/cathy.smith/">http://www.esrl.noaa.gov/psd/people/cathy.smith/</a>
Emails about data/webpages may get quicker responses from emailing
<a class="moz-txt-link-abbreviated" href="mailto:esrl.psd.data@noaa.gov">esrl.psd.data@noaa.gov</a></pre>
</body>
</html>