[ncl-talk] adjusting tension of a smooth overlaid on xyplot

Mary Haley haley at ucar.edu
Fri Aug 7 13:13:33 MDT 2015


Sam,

Here's a slightly better example, that uses dummy data read off a NetCDF
file. The script is pretty much the same, except I changed the data and
added more tension factors to test. I also created a panel plot for
comparison.

I've also added this example to our 1D interpolators page:

http://www.ncl.ucar.edu/Applications/interp1d.shtml#ex3

--Mary

On Fri, Aug 7, 2015 at 12:43 PM, Mary Haley <haley at ucar.edu> wrote:

> Hi Sam,
>
> It appears you are using the parameter correctly.
>
> Please try running the attached example, which shows a simple XY plot, and
> different tension factors using the "sig" parameter with ftcurv.
>
> If this doesn't shine a light on the problem at your end, then can you
> provide us with a script and the data?
>
> --Mary
>
>
> On Tue, Aug 4, 2015 at 5:07 PM, Sam McClatchie (NOAA Federal) <
> sam.mcclatchie at noaa.gov> wrote:
>
>> Colleagues
>>
>> I want to put a smooth line through a de-seasonalized time series that
>> shows a trend and residual variability. I'm having trouble adjusting the
>> tension of the smooth which I think needs to be less than one. I would like
>> the overlaid smooth curve to be much more smooth than the data, but I'm
>> basically getting a high order polynomial smooth at present.
>>
>> Here is a snip of code:
>>
>> (Note: the xyplot tsplots(2) was previously defined)
>>
>> xi = (/spice_ts_ss&time/)
>> yi = monthly_anom(:,0,0)
>> xo = fspan(1985., 2015., 200)
>> ftsetp("sig",0.5)
>> yo = ftcurv(xi,yi,xo)
>>
>> colors = (/"red","green","blue"/)
>> resplot at xyLineColor   = colors(0)
>> tsplots(3)  = gsn_csm_xy (wks,xo,yo,resplot)
>> overlay(tsplots(2), tsplots(3))
>>
>> Changing the value of the sig parameter in ftsetp between 0.1 to 40 seems
>> to have no effect, which suggests that I am misusing something?
>>
>> Thanks in advance,
>> Sam
>> --
>> Sam McClatchie,
>> Supervisory oceanographer,
>> NOAA lead for the CalCOFI program
>> Southwest Fisheries Science Center, NOAA,
>> 8901 La Jolla Shores Dr.
>> La Jolla, CA 92037-1509, U.S.A.
>> email <Sam.McClatchie at noaa.gov> <Sam.McClatchie at noaa.gov>
>> Office: 858 546 7083, Cellular:  858 752 8495
>> Research home page <www.fishocean.info>
>> [image: CalCOFI 66 years]
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150807/9474f014/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CalCOFI_66_year_logo.png
Type: image/png
Size: 23689 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150807/9474f014/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestData.xy3.nc
Type: application/x-netcdf
Size: 15244 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150807/9474f014/attachment.nc 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftcurv_tension_panel.png
Type: image/png
Size: 199598 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150807/9474f014/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ftcurv_sig_example2_panel.ncl
Type: application/octet-stream
Size: 1932 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150807/9474f014/attachment.obj 


More information about the ncl-talk mailing list