[Thread Prev][Thread Next][Index]

Re: [ferret_users] Use of legline.jnl on time axis



No trick. No easy way, either. There are 2 possibilities:

1. After having made the plot, do PPL LIST TAXIS. The output will look something like this:

yes? ppl list taxis

TAXIS QUALITIES
LO= 8.76E+03 DT= 6.00E+01 CSIZE= 1.00E-01 TYPE= TAXIS3 VANG= 0.00E+00
TOP AXIS= ON BOTTOM AXIS= ON
TMIN=19920101000000 0:00 JAN 1,1992
TMAX=20030101000000 0:00 JAN 1,2003
TSTART=19901231235724 23:57 DEC 31,1990
NMTC= -1 LABEL= -3 IFDB= 3 ISDB= 1 TAXIS= XAXIS IAUTOT= ON

TMIN is the starting value of the plotted time axis. TSTART is the beginning of the time axis (not on the plot but somewhere in Ferret's mind). It is usually about 1 year earlier than TMIN, as shown here. All references to a location on the plot must be relative to TSTART, not TMIN. DT is the time unit Ferret is using, in minutes (here it is one hour).

Thus,, to make a legend line of length 1 year, beginning 1 year to the right of TMIN, do something like:

go legline.go `365*24*2` `365*24` [yvalue] [line_type] [char_ht] "this is the label to use"

2. In response to this cumbersome method, which cannot be automated because it requires the plot to be made and inspected, Emily Vanvyve figured out how to do a legend line in NOUSER units. The script converts NOUSER to USER units, then calls legline.go. It is not bullet-proof but often works. Here is the script:

\can mode verify
! make a legend line and its label (nouser units) (Vanvyve e-mails 25 July 2003)
! still calls user-unit legline script, but pre-chooses to make nouser units

! arg1=x-value of line starting point (fraction of plot width)
! arg2=length of line (fraction of plot width)
! arg3=y-value of line (fraction of plot height)
! arg4=line type (number 1-19)
! arg5=text character height
! arg6=label text
! only gets label position right for positive-up axes

let xrange `($xaxis_max) - ($xaxis_min)`
let yrange `($yaxis_max) - (($yaxis_min))`
let leg1 `($xaxis_min) + xrange*$1`
let leg2 `xrange*$2`
let leg3 `($yaxis_min) + yrange*$3`

go legline.go `leg1` `leg2` `leg3` $4 $5 "$6"
set mode/last verify

Additional complications ensue when the vertical plot axis is down (a depth axis). Clearly Ferret needs a better legend line situation than these user kluges.

Billy K
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
William S. Kessler
NOAA / Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115 USA

william.s.kessler@noaa.gov
Tel: 206-526-6221
Fax: 206-526-6744
Home page: http://www.pmel.noaa.gov/~kessler


On Sep 28, 2005, at 4:11 AM, Paulo B. Oliveira wrote:

Hi,

What's the trick to make legline work with a time-series plot ?
Here is a test script and the results to illustrate the problem:
------------------------------------------------------------
def ax/t=1-jan-2005:21-feb-2005:1/unit=day t1
set win/asp=0.5
set viewp left
plot/i=1:10 i
go legline 1 5 5 2 0.2 LAB1
set view right
plot t[gt=t1]
go legline `t[gt=t1,t=1-jan-2005]` 5 37990 2 0.2 LAB1
frame/file=legline_test.gif
------------------------------------------------------------

Best regards,
Paulo
<legline_test.gif> ! NOAA/PMEL TMAP
 ! FERRET v5.81
 ! Linux(g77) 2.4.21-32 - 07/13/05
 ! 27-Sep-05 19:57

def ax/t=1-jan-2005:21-feb-2005:1/unit=day t1

set win/asp=0.5

set viewp left
 plot/i=1:10 i
 go legline 1 5 5 2 0.2 LAB1

set view right
 plot t[gt=t1]
 go legline `t[gt=t1,t=1-jan-2005]` 5 37990 2 0.2 LAB1

frame/file=legline_test.gif

quit







[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement