<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>To answer an offline query sent to me:<br> Yes. you did post this question before. However, it was a holiday yesterday.<br><br>---<br></div>The
EXCEL plot looks nice *but* is it 'correct?' The orange line between
'x' values 4 and 6 is above 4.5. Is that correct? Likely, some
interpolation method was used 'under-the-hood' prior to drawing the
curve. How else can you get the values between (say) x=4 and x=6?<br></div><br>---<br><a target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ftcurv.shtml">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>ftcurv.shtml</a><br><a target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ftsetp.shtml">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>ftsetp.shtml</a><br><br></div> xi = (/.../)<br></div> yi = (/.../)<br></div> nx = dimsizes(xi)<br><br></div> N = 5*nx ; arbitrary<br></div> xo = fspan(min(x), max(x), N)<br><br> ;<b>ftsetp</b>("sig",0.9) ; you may have to 'play' with this<br></div><div> ; default is 1.0<br></div><div> yo = <b>ftcurv</b>(xi, yi, xo)<br><br></div>plot xo,yo<br><br></div><div>===BETTER===<br><br></div>undef("mimic_excel")<br></div>function mimic_excel(xi[*]:numeric, yi[*]:numeric, N[1]:integer, sig[1]:numeric)<br></div><div>local xo, yo<br></div>begin<br> xo = fspan(min(xi), max(xi), N)<br></div><div> if (sig.ne.1.0) then<br></div><div><b> ftsetp</b>("sig",sig) <br> end if<br> yo = <b>ftcurv</b>(xi, yi, xo)<br></div><div> return( [/ xo, yo/] ) ; return as list variable<br></div>end<br><div><br></div><div>;==== MAIN<br><br> xi = (/.../)<br> yi = (/.../)<br></div><div> nx = dimsizes(xi)<br></div><div> N = 5*nx ; 5 is arbitrary<br></div> sig = 1.0 ; default<br><br></div> xyo = mimic_excel(xi, yi, N, sig)<br></div> xo = xo[0]<br></div> yo = yo[1]<br><div><div><div><br></div><div>Good luck<br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 20, 2017 at 1:39 PM, xiaoming Hu <span dir="ltr"><<a href="mailto:yuanfangcan@hotmail.com" target="_blank">yuanfangcan@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_2134589520809009344divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif" dir="ltr">
<p>Hello <br>
</p>
<p><br>
</p>
<p> I am wondering if NCl provide a smooth option for xy plots like Excel: <br>
</p>
<p><img size="0" style="max-width:99.9%" id="m_2134589520809009344img533841" src="cid:a655862b-56fe-412f-b91d-e01e8a4459f9"></p>
<p>In NCL, it seems only straight lines are allowed between data points. <br>
</p>
<p><br>
</p>
<p>Thanks</p><span class="HOEnZb"><font color="#888888">
<p>Xiaoming <br>
</p>
<p><br>
</p>
</font></span></div>
</div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>