[Thread Prev][Thread Next][Index]

Re: simple plot



Hi Wang,
	sorry, there's a mistake in my previous mail. As your data 
varies in time dimension too, you should sum over that dimension also 
in creating p, q, r and s. So, just replate those lines by the 
followings:

 let p = xv[x=@sum,y=@sum,t=@sum]
 let q = yv[x=@sum,y=@sum,t=@sum]
 let r = xy[x=@sum,y=@sum,t=@sum]
 let s = xx[x=@sum,y=@sum,t=@sum]



regards,

arindam chakraborty


On Fri, 5 Nov 2004, Arindam Chakraborty wrote:

> hi Wendy,
> 	you can do it in the following way:
> 
>  let xv = temp[k=2]; ! define variable which will be along x-axis
>  let yv = s[k=2]; ! define variable which will be along y-axis
> 
> ! plot the data
>  plot/vs/sym=1 xv, yv
> 
> ! now make the linear fit using least square method
> ! basically calculate ave and amp of the equation: y = amp*x + ave
> 
>  let xy = xv*yv
>  let xx = xv*xv
> 
>  let p = xv[x=@sum,y=@sum]
>  let q = yv[x=@sum,y=@sum]
>  let r = xy[x=@sum,y=@sum]
>  let s = xx[x=@sum,y=@sum]
> 
>  let n = xy[x=@ngd,y=@ngd]
>  list n
> 
>  let amp =  (n*r - p*q)/(n*s - p*p)
>  let ave = (q - amp*p)/n
> 
>  list amp, ave
> 
> 
> Hope this helps,
> 
> ----------------------------
>  ARINDAM CHAKRABORTY
>  Department of Meteorology
>  Florida State University
>  Tallahassee, FL-32306, USA
>  Tel: +001-850-6443524 (Off)
>       +001-850-5758550 (Res)
>  Fax: +001-850-6449642
>  email: arch@io.met.fsu.edu
>         arindam@met.fsu.edu
> ____________________________
> 
> On Fri, 5 Nov 2004, Wendy Wang wrote:
> 
> > Hi ferret_users,
> > 
> > I have a dataset like:
> > 
> >   name     title                                  I         J         K 
> >      L
> >   S        Salinity                         1:161     1:91      1:21      1:636
> >   TEMP     Temperature              1:161     1:91      1:21      1:636
> > 
> > I want to make one scatter plot using k=2 data:
> > X axis is temp, Y axis is S. Then do the linear fit.
> > 
> > Does someone know how? It may be simple,
> > but I cannot figure it out.
> > 
> > Thanks in advance.
> > Wendy Wang 
> > 
> 
> 
> 



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement