[Thread Prev][Thread Next][Index]

[ferret_users] Locating a label based on the date on a time axis plot.



Hi all,

Here is a solution to the empty FAQ entry about
"Locating a label based on the date on a time axis plot."

What is not trivial is that in a time axis plot the time axis units
is automatically set to some units that are not accessible.
See command : ppl list taxis

A trick is to use a null plot command before a label command.
The plot command will define the ($PPL$XFIRST1) symbol that
can be then used by the label command.

Attached a demo script and its image.

Patrick

--
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
IPSL Global Climate Modelling Group
--

GIF image

!----------------------------------
use monthly_navy_winds.cdf

let var=UWND[i=20,j=30]
plot/vlim=-10:4 var

!----------------------------------
let tt=t[gt=var]

!----------------------------------
! Locate label position on time var axis
let datelabelpos=tt[t="01-JAN-1985"@itp]

! Do nothing but set $PPL$XFIRST1 symbol at the time axis plot units
plot/line/vs/over/nolab datelabelpos,-9
! LABEL xpos, ypos, justify, rotate, height "text"
label ($PPL$XFIRST1),-8,-1,0,0.1,"Year 85 starts"

plot/vs/nolab/line/color=red/over {`datelabelpos`,`datelabelpos`},{-10,4}

!----------------------------------
! Locate label position on time var axis
let datelabelpos=tt[t="01-JAN-1987"@itp]

! Do nothing but set $PPL$XFIRST1 symbol at the time axis plot units
plot/line/vs/over/nolab datelabelpos,-9
! LABEL xpos, ypos, justify, rotate, height "text"
label ($PPL$XFIRST1),-8,-1,0,0.1,"Year 87 starts"

plot/vs/nolab/line/color=red/over {`datelabelpos`,`datelabelpos`},{-10,4}

!----------------------------------
! Locate label position on time var axis
let datelabelpos=tt[t="02-JUN-1989"@itp]

! Do nothing but set $PPL$XFIRST1 symbol at the time axis plot units
plot/line/vs/over/nolab datelabelpos,-9
! LABEL xpos, ypos, justify, rotate, height "text"
label ($PPL$XFIRST1),0,-1,0,0.1,"My 20th birthday \!"

plot/vs/nolab/line/color=red/over {`datelabelpos`,`datelabelpos`},{-10,4}

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement