[Thread Prev][Thread Next][Index]

Re: How to overlay a symbol on a time series plot



Hi,

Certain types of overlays on time axes are awkward in Ferret version 5.0 and earlier. The use of
overlapping viewports is a solution in addition to what Mick Spillane suggested. Also, the use of
CANCEL MODE CALENDAR in certain cases.

In version 5.1 overlays on time axes will be easier. The following script and plot (attached)
illustrate how it will be done in V5.1.

    - steve

================================================

     use coads_climatology

     ! coordinates of a unit square
     LET xsqr = {-1,1,1,-1}
     LET ysqr = {-1,-1,1,1}

     ! coordinates of unit circle
     LET xcircle = COS(6.3*i[i=1:42]/40)
     LET ycircle = SIN(6.3*i[i=1:42]/40)

     ! *** Here is some (any) time series plot ***
     plot/x=180/y=0 sst

     ! tt is the coordinates along the T axis
     let tt = T[gt=sst]

     ! place an "X" at the value exactly at 7-aug
     ! "@ITP" causes interpolation to exact location
     let t0   = tt[t="7-aug-0000"@itp]
     let val0 = sst[x=180,y=0,t="7-aug-0000"@itp]
     plot/vs/over/nolab/sym=2/line=8 t0,val0

     ! put a box around the "X"
     polygon/over/line=8/title="Special region" t0+500*xsqr, 0.05*ysqr+val0

     ! place an "X" on the data point nearest to 15-may
     ! Note that @ITP is absent, so behavior is set by MODE INTERPOLATE
     let t1   = tt[t="15-may-0000"]
     let val1 = sst[x=180,y=0,t="15-may-0000"]
     plot/vs/over/nolab/sym=2/line=10 t1,val1

     ! put a circle around the "X"
     plot/vs/over/line=10/nolab t1+500*xcircle,0.05*ycircle+val1

================================================
Yang Haijun wrote:

> Hi Dear ferreters,
>
> How can I overlay a symbol on a time series plot?
>
> For example, I have a station temperature with 40 years. I get the mean temperature over 40
> years. Then I plot the time series of temp,
>
>  yes? plot/l=1:40 temp
>  yes? let tmean=temp[l=1:40]
>
> Now I want to plot a symbol which represents tmean, on the time series plot. How can I get that?
>
> Thanks a lot.
>
> Haijun Yang

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744

GIF image


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement