[Thread Prev][Thread Next][Index]

Re: How to move plot keys?



I wrote a set of legend scripts that are more complicated,
but also allow complete flexibility about the legend
(Emily Vanvyve also contributed). The first one is in user
units, the second is no-user units (calls the first after
converting to user units):

------------------------- legline.go -------------
\can mode verify
! make a legend line and its label
! arg1=x-value of line starting point (user units)
! arg2=length of line (user units)
! arg3=y-value of line
! arg4=line type (number 1-19)
! arg5=text character height
! arg6=label text
! only gets label position right for positive-up axes

define symbol xend `$1+$2`
define symbol txstart `($xend)+$2/10`
ppl %range ($ppl$ymin1) ($ppl$ymax1) 10		! get axis range user units
define symbol drop `$5/2`			! half char hgt in inches
define symbol txypos `($3)-(($drop))*((($ppl$range_high))-(($ppl$range_low)))/($ppl$ylen)`
! set pen for a dummy line number (not to interfere)
ppl pen,77,$4
ppl aline 77 $1 $3 ($xend) $3 
label ($txstart) ($txypos) -1 0 $5 $6
set mode/last verify
------------------------- legline-nu.go -----------
\can mode verify
! make a legend line and its label (nouser units)
! 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
-------------------------

Billy K



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement