Overlaying a time series on a 2D plot
How can I plot a time series on top of a SHADE or CONTOUR plot?
This FAQ describes a situation that has been remedied in Ferret/PyFerret versions beginning with V7. In versions higher than that, you may overlay a time series on a 2-D plot with no further adjustments.
Previous to the above versions, in order successfully to overlay a time series plot over a 2-dimensionalplot with a time axis (a Hovmoller diagram) it is essential that thetime axis of the data passed to the SHADE or CONTOUR command be in unitsof HOURS.
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 Hovmoller plot
! (THIS WILL NOT WORK --> try to overlay a time series. The time scaling is off.)
! If running Ferret v6.96 or PyFerret 1.2, the above PLOT/OVER command draws the line correctly, and we are done.
! But this will work around the problem
DEFINE AXIS/T="1-JAN-1980":"1-JAN-1990":24/UNITS=HOURS thours
The plot above was created with:
define axis/t="15-jan-1982":"15-dec-1983":24/units=hours thours