pslegend - ancillary GMT utility written by hgs

Usage:

         pslegend [-yposexpr] [-l[min/]max] [-tfile]
                  [-Xloc] [-Yloc] [-K] [-P] [-V]
                   -JXxwide/ywide
                  [+ [options for psxy drawing the legend frame]]

Purpose:

Draws the legend using the commands contained in  file.
That  file  ought to be built with addlegend.
 
Options:

 -[F]H "<text>" - Title, more than one word,
 -
[F]H<word>      alt. one word,
                  to appear above the legend's body. Default is no title.
                  The -FH version requests a fat font.
                  The legend box will be extended at the upper edge;
                  therefore, the addlegend commands must be issued with -d-1
 
 -y
posexpr      - The position expression  posexpr must consist of:

                  anything/ymin/ymax
                  i.e. the minimum and maximum positions (legend line
                  numbers in internal units) are required. ymax must
                  include a space above the top line. Thus, to print
                  a one-line legend you would need to specify
                   -y99/0/1
                  In order to keep things simple for you the posexpr
                  that is returned from the last call to addlegend can
                  be re-used, as in
                      y=`echo comment | addlegend ...`
                      pslegend -y$y...

 -yposexpr/offs - offs is a vertical offset for the text with respect to
                  the box bottom. Default=0.15 (good if inch). Units are
                  your .gmtdefaults4 MEASURE_UNIT.  Thus, it is possible
                  to call pslegend -y$y/0.2...

 -l[min/]max    - If you are not happy with the ymin,ymax values in $y, 
                  use this option instead.
 
 -tfile         - Command file, default = .gmtlegend.cmd  It will be
                  moved to file.bak  after the legend has been drawn.
 
 -Xloc -Yloc    - distance from current origin for placement of the
                  legend. Lower left corner of legend box is used.
                  This offset will not persist after the conclusion of
                  pslegend.

 -JXxwide/ywide - specify the width of the box in your MEASURE_UNIT.
 
 -K -P -V       - are as usual in GMT. Also, add-to-plot ( -O ) is
                  automatically assumed.

Options for psxy drawing the legend frame:

 +              - required as a delimiter in front of options that are to
                  be passed to a psxy command to draw a box around the
                  legend. These are:
 
 -L -Gcolor     - optionally draw a closed box with the fill according
                  to -Gcolor, and optionally add ...
 -Wpen            to draw the box outline.
 

Obs!
 
Needs ~hgs/bin/ecq (est-ce que ?)

Side effects:
  pslegend ... -K ...

You will need to call subsequent GMT procedures with re-specification of
region (-Ra/b/c/d) and projection (-Jpv/w...) since pslegend uses them
internally. I'll have to think of a method with less interference.

You can set a copy of .gmtcommands4 aside and restore it after pslegend ... -K 
Make automatic??