Re: Want to plot two separate trend line

From: Will Hobbs <Will.Hobbs_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 13 2012 - 14:24:14 MST

Soumik

There are several ways you could do this: if you're modifying an existing
script then the first is probably easiest.

1. Draw the trends as polylines:
http://www.ncl.ucar.edu/Applications/polyg.shtml

2. Calculate 'synthetic' data points using regline, and plot them as a
regular xy plot .e.g. for a 1-d array, x:

> xAll = new((/2,dimsizes(x)/), typeof(x)) ;new array for data
> xAll(0,:) = x ; add raw data to array

> reg = regline(time,x)

>xAll(1,:) = reg@yintercept + (time * reg) ;points along a trend line
>for each time step

> plot = gsn_csm_xy(wks, time, xAll, res) ; will plot two lines, a trend
>and the raw data

Will

On 14/12/12 6:21 AM, "Soumik Basu" <sbasu@iarc.uaf.edu> wrote:

>Hi,
>
>I am plotting a time series from 1979 to 2008. I want to calculate two
>separate trends : one from 1978 to 1995 and other from 1996 to 2008. Is
>there any example showing how to draw two separate trend lines like
>that.
>
>Thanks,
>Soumik
>
>--
>"Numbing the pain for a while will make it worse when you finally feel
>it.
> ~J.K. Rowling"
>*****************************************
>Soumik Basu
>Graduate Student, Research Assistant
>International Arctic Research Center
>University of Alaska Fairbanks
>Fairbanks,Alaska,USA
>*****************************************
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 13 14:24:28 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 21 2012 - 10:43:23 MST