Return to Ferret FAQ


Overlaying a time series.


Question:

How can I plot a time series on top of a SHADE or CONTOUR plot?

Example:

[Output Graphic]

Explanation:

In order successfully to overlay a time series plot over a 2-dimensional plot with a time axis (a Hofmuller diagram) it is essential that the time axis of the data passed to the SHADE or CONTOUR command be in units of HOURS.

Solution:

These commands illustrate the problem and the work-around:
! define a 2D field in YT with a time axis in units of DAYS
DEFINE AXIS/T="1-JAN-1980":"1-JAN-1990":1/UNITS=DAYS tdays
DEFINE AXIS/Y=0:40N:2/UNITS=DEGREES yax
DEFINE GRID/y=yax/t=tdays gg
SET GRID gg
LET my_var = 10*cos(T/2000)*EXP((-1)*y/20)

! make a Hofmuller plot
SHADE my_var

! (THIS WILL NOT WORK (as of V4.91) --> try to overlay a time series 
PLOT/OVER my_var[Y=@loc:-4]

! But this will work around the problem
DEFINE AXIS/T="1-JAN-1980":"1-JAN-1990":24/UNITS=HOURS thours
SHADE my_var[GT=thours]
PLOT/OVER my_var[Y=@loc:-4]
The plot above was created with:
use coads_sst
set region/x=40w/y=10n:60n
define axis/t="15-jan-1982":"15-dec-1983":24/units=hours thours
shade sst[gt=thours]
plot/over sst[y=30n]


Last modified: Aug 25, 1998