|
1. 画笔属性
GMT中的画笔包含三个属性:width, color, and texture. 大多数绘图命令都可以设置画笔的属性,格式如下:
-W[Width[c|i|p|m]], [color], [texture[c|i|p|m]]
width, 画笔绘制的线条的宽度,通常默认单位为p(1/72 inch)。GMT预定义了一些线条的宽度,如下表:
Pen Name
| Width
| Pen Name
| Width
| faint
| 0
| thicker
| 1.5p
| default
| 0.25p
| thickest
| 2p
| thinnest
| 0.25p
| fat
| 3p
| thinner
| 0.50p
| fatter
| 6p
| thin
| 0.75p
| fattest
| 12p
| thick
| 1.0p
| obese
| 18p
|
color, 设置画笔的颜色。常用的颜色模式有Gray, RGB, HSV, CMYK四种。
ü Gray:范围是从0~255(black[0], white[255])
ü RGB:r/g/b, 每一个的范围都是0~255. 0/0/0表示black,255/255/255表示white,255/0/0表示red;
ü HSV:hue-saturation-value, hue的范围是0~360,后两个的范围是0~1
ü CMYK:cyan/magenta/yellow/black, 每个值的范围是0~100%
此外,GMT还预定义了一些颜色(663种),可以通过gmtcolors命令查看这些颜色名称。
texture, 线型。常见的线型有:
.(to) dotted line
-(ta) dashed line
.- dot-dashed line
..- dot-dot-dashed line
solid solid line
此外,还可以自定义线型,定义格式为[t]stringffset,其中
string=length_gap_length_gap (length是线段的长度;gap是线段间的间隔)
offset: 线段起始位置距离线的起点的间距
如:[t]20_10_5_10:10
画笔属性举例:
Pen Examples
| Comment
| -W0.5p
| Solid black line, 0.5 point thick
| -Wgreen
| Solid green line with default width
| -Wthin,red,-
| Dashed, thin red line
| -Wfat,.
| Fat dotted line[black]
| -W0.1c,120-1-1
| Green(in HSV) pen, 1mm thick
| -Wfaint,100/0/0/0,..-
| Very thin, cyan(in CMYK), dot-dot-dashed line
|
2. 填充属性
同画笔属性一样,许多GMT命令提供了填充属性,用来填充绘制的多边形或符号。通常有两种填充方式:
1) –Gfill
fill同画笔的color属性。
2) -Gpdpi/pattern[:Bcolor][Fcolor]
dpi表示设备分辨率;pattern是一个1~90之间的整数;[:Bcolor]表示背景色;[Fcolor]表示前景色。当颜色设为-,表示是透明色。
填充属性举例:
Fill Example
| Comment
| -G128
| Solid gray
| -GDarkOliveGreen1
| One of the named colors
| -Gp300/7:Bred
| With red lines on white?
| -Gp300/7:BredF-
| Gaps between red lines are transparent
|
|
|