Use a number to set the width. Append c, i, or p to specify pen width in cm, inch, or points, respectively.
If not unit is append, them points is used as the unit. In GMT these units are related in this way:
You can use one of the following preset names to define its width:
faint
0
thin
0.75p
fat
3p
default
0.25p
thick
1p
fatter
6p
thinnest
0.25p
thicker
1.5p
fattest
10p
thinner
0.5p
thickest
2p
wide
18p
In the following example we show all the preset names (with differents colors).
Note: In the following examples the -Y parameter is only used to move the lines vertically. Otherwise the lines would be overlapped. It does not affect the line attributes.
This can be achieved by giving zero width (or faint).
The result is device-dependent but typically means that as you zoom in on the feature in a display, the line thickness stays at the minimum.
Also combinations of dots and dashes, like .- for a dot-dashed line, are allowed.
Note: The lengths of dots and dashes are scaled relative to the pen width
(dots has a length that equals the pen width while dashes are 8 times as long; gaps between segments are 4 times the pen width).
For more detailed attributes (including exact dimensions) you may specify string[:offset]. This is a series of numbers separated by underscores (_).
These numbers represent a pattern by indicating the length of line segments and the gap between segments.
The optional offset phase-shifts the pattern from the beginning the line.
For example, if you want a thin line that alternates between long dashes (9 points), an 4 point gap, then a 3 point dash,
then another 4 point gap, with pattern offset by 13 points from the origin, specify
-Wthin,9_4_3_4:13p.
Just as with pen width, the default style units are points, but can also be explicitly specified in cm, inch, or points (see width discussion above).
Here we show some examples of different style lines:
Here we show some examples of lines combining the three basic attributes.
Note: In the last two examples the -Y parameter is NOT used so that the lines are intentionally overlapped to achieve more complex lines.
gmtbeginbasic_linespng
gmtbasemap-R0/10/0/2-Jx1c-B0-LjBR+w1c+jBR+l" cm"+o0.4c
echo0.51.8>tmp
echo8.01.8>>tmp
gmtplottmp-W
gmtplottmp-Y-0.2c-W1p,red,-
gmtplottmp-Y-0.2c-W1p,blue,.
gmtplottmp-Y-0.2c-W1p,lightblue,-.
gmtplottmp-Y-0.2c-W2p,blue,..-
gmtplottmp-Y-0.2c-W2p,tomato,4_2:2p
# Complex example of a 5p wide black line with a 2p wide red line above itgmtplottmp-Y-0.3c-W5p,black
gmtplottmp-W2p,red
# Complex example of 5p wide black line and 4p wide white dashed line on top of itgmtplottmp-Y-0.3c-W5p,black
gmtplottmp-W4p,white,20p_20p
gmtend