This file contains instruction for the layout of items in the legend. Each legend item is described by
a unique record. All records begin with a unique character that is common to all records of the same
kind. The order of the legend items is implied by the order of the records. Ten different record types
are recognized, and the syntax for each of these records are presented below:
# comment Records starting with # and blank lines are skipped.
|-D||Positions the legend and specifies its size. The just is a 2-char justification string (see pstext) that relates the given position to a point on the rectangular legend box. If you want to specify the position in map plot units (i.e., inches or cm), use -Dx.|
Selects the map projection. Scale is UNIT/degree, 1:xxxxx, or width in UNIT (upper case modifier).
UNIT is cm, inch, or m, depending on the MEASURE_UNIT setting in .gmtdefaults4, but this can be
overridden on the command line by appending c, i, or m to the scale/width value.
When central meridian is optional, default is center of longitude range on -R option.
Default standard parallel is the equator.
For map height, max dimension, or min dimension, append h, +, or - to the width,
More details can be found in the psbasemap man pages.
-Jalon0/lat0[/horizon]/scale (Lambert Azimuthal Equal-Area)
-Jp[a]scale[/origin][r|z] (Polar coordinates (theta,r))
|-R||xmin, xmax, ymin, and ymax specify the Region of interest. For geographic regions, these limits correspond to west, east, south, and north and you may specify them in decimal degrees or in [+-]dd:mm[:ss.xxx][W|E|S|N] format. Append r if lower left and upper right map coordinates are given instead of w/e/s/n. The two shorthands -Rg and -Rd stand for global domain (0/360 and -180/+180 in longitude respectively, with -90/+90 in latitude). Alternatively, specify the name of an existing grid file and the -R settings (and grid spacing, if applicable) are copied from the grid. For calendar time coordinates you may either give (a) relative time (relative to the selected TIME_EPOCH and in the selected TIME_UNIT; append t to -JX|x), or (b) absolute time of the form [date]T[clock] (append T to -JX|x). At least one of date and clock must be present; the T is always required. The date string must be of the form [-]yyyy[-mm[-dd]] (Gregorian calendar) or yyyy[-Www[-d]] (ISO week calendar), while the clock string must be of the form hh:mm:ss[.xxx]. The use of delimiters and their type and positions must be exactly as indicated (however, input, output and plot formats are customizable; see gmtdefaults).|
No space between the option flag and the associated arguments.
-B Sets map boundary annotation and tickmark intervals; see the psbasemap man page for all the details. -C Sets the clearance between the legend frame and the internal items [0.15c/0.15c (or 0.05i/0.05i)]. -F Draws a border around the legend using FRAME_PEN. -G Select fill shade, color or pattern of the legend box [Default is no fill]. (See SPECIFYING FILL below). -K More PostScript code will be appended later [Default terminates the plot system]. -L Sets the linespacing factor in units of the current annotation font size [1.1]. -O Selects Overlay plot mode [Default initializes a new plot system]. -P Selects Portrait plotting mode [Default is Landscape, see gmtdefaults to change this]. -S Instead of writing the PostScript plot [Default], output the GMT script used to make the legend to standard output, or optionally to the file script. -U Draw Unix System time stamp on plot. By adding just/dx/dy/, the user may specify the justification of the stamp and where the stamp should fall on the page relative to lower left corner of the plot. For example, BL/0/0 will align the lower left corner of the time stamp with the lower left corner of the plot. Optionally, append a label, or c (which will plot the command string.). The GMT parameters UNIX_TIME, UNIX_TIME_POS, and UNIX_TIME_FORMAT can affect the appearance; see the gmtdefaults man page for details. The time string will be in the locale set by the environment variable TZ (generally local time). -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. -X -Y Shift plot origin relative to the current origin by (x-shift,y-shift) and optionally append the length unit (c, i, m, p). You can prepend a to shift the origin back to the original position after plotting, or prepend r [Default] to reset the current origin to the new location. If -O is used then the default (x-shift,y-shift) is (0,0), otherwise it is (r1i, r1i) or (r2.5c, r2.5c). Alternatively, give c to align the center coordinate (x or y) of the plot with the center of the page based on current page size. -c Specifies the number of plot copies. [Default is 1].
pen The attributes of lines and symbol outlines as defined by pen is a comma delimetered list of width, color and texture, each of which is optional. width can be indicated as a measure (points, centimeters, inches) or as faint, thin[ner|nest], thick[er|est], fat[ter|test], or obese. color specifies a gray shade or color (see SPECIFYING COLOR below). texture is a combination of dashes - and dots ..
fill The attribute fill specifies the solid shade or solid color (see SPECIFYING COLOR below) or the pattern used for filling polygons. Patterns are specified as pdpi/pattern, where pattern gives the number of the built-in pattern (1-90) or the name of a Sun 1-, 8-, or 24-bit raster file. The dpi sets the resolution of the image. For 1-bit rasters: use Pdpi/pattern for inverse video, or append :Fcolor[B[color]] to specify fore- and background colors (use color = - for transparency). See GMT Cookbook & Technical Reference Appendix E for information on individual patterns.
color The color of lines, areas and patterns can be specified by a valid color name; by a gray shade (in the range 0-255); by a decimal color code (r/g/b, each in range 0-255; h-s-v, ranges 0-360, 0-1, 0-1; or c/m/y/k, each in range 0-1); or by a hexadecimal color code (#rrggbb, as used in HTML). See the gmtcolors manpage for more information and a full list of color names.
To add an example of a legend to a Mercator plot (map.ps) with the given specifications, use
pslegend -R-10/10/-10/10 -JM 6i -G azure1 -Dx 0.5i/0.5i/5i/3.3i/BL -C 0.1i/0.1i -L 1.2 -F -B 5f1 << EOF >> map.ps
# Legend test for pslegend
# G is vertical gap, V is vertical line, N sets # of columns, D draws horizontal line.
# H is header, L is label, S is symbol, T is paragraph text, M is map scale.
H 24 Times-Roman My Map Legend
D 0.2i 1p
V 0 1p
S 0.1i c 0.15i p300/12 0.25p 0.3i This circle is hachured
S 0.1i e 0.15i 255/255/0 0.25p 0.3i This ellipse is yellow
S 0.1i w 0.15i 0/255/0 0.25p 0.3i This wedge is green
S 0.1i f 0.25i/-1/0.075ilb 0/0/255 0.25p 0.3i This is a fault
S 0.1i - 0.15i - 0.25tap 0.3i A contour
S 0.1i v 0.25i/0.02i/0.06i/0.05i 255/0/255 0.25p 0.3i This is a vector
S 0.1i i 0.15i 0/255/255 0.25p 0.3i This triangle is boring
V 0 1p
D 0.2i 1p
M 5 5 600+u f
I SOEST_logo.ras 3i CT
B colors.cpt 0.2i 0.2i
G 0.05i L 9 4 R Smith et al., @%5%J. Geophys. Res., 99@%%, 2000
T Let us just try some simple text that can go on a few lines.
T There is no easy way to predetermine how many lines will be required,
T so we may have to adjust the box height to get the right size box.
Note that under Windows, the percent sign (%) is a variable indicator (like $ under Unix). To indicate a plain percentage sign in a batch script you need to repeat it (%%); hence the font switching mechanism (@%font% and @%%) may require twice the number of percent signs. This only applies to text inside a script or that otherwise is processed by DOS. Data files that are opened and read by pslegend do not need such duplication.
|GMT 4.5.14||PSLEGEND (1)||1 Nov 2015|