当前位置:首页 >> 电力/水利 >>

GMT


'

$

Command-line arguments
? Each program requires certain arguments to de?ne its operation. ? Arguments are explained in the manual pages and in the usage
messages.

? Each argument speci?cation begins with a hyphen, followed by a
letter, and sometimes a number or character string immediately after the letter.

? Do not space between the hyphen, letter, and number or string. ? Do space between options. ? Example: pscoast -R0/20/0/20 -G200 -JM6i -W0.25p
-B5 -V > map.ps

&

%

'

$

Standardized arguments (1/2)
Among the many possible arguments in GMT, 13 have the same meaning for all programs:

? -B De?nes tickmarks, annotations, and labels for basemaps and axes ? -H Speci?es that input tables have header record(s) ? -J Selects a map projection or one of several non-map projections ? -P Selects Portrait plot orientation [Default is landscape] ? -R De?nes the min. and max. coordinates of the map/plot region ? -U Plots a time-stamp, by default in the lower left corner of page ? -V Verbose operation
&

%

'

$

Standardized arguments (2/2)
? -X Sets the x-coordinate for the plot origin on the page ? -Y Sets the y-coordinate for the plot origin on the page ? -c Speci?es the number of plot copies ? -: Input geographic data are (lat,lon) rather than (lon,lat) ? -K Allows more plot code to be appended to this plot later ? -O Allows this plot code to be appended to an existing plot

&

%

'

$

Standardized arguments: exercises
? Verbose:
pscoast -R0/360/-70/70 -JM6.5i -Ba60f30 -G0 -Dc -P -V > GMT mercator.ps

? Time tag:
pscoast -R0/360/-70/70 -JM6.5i -Ba60f30 -G0 -Dc -P -U > GMT mercator.ps

? Landscape:
pscoast -R0/360/-70/70 -JM6.5i -Ba60f30 -G0 -Dc -U > GMT mercator.ps

? Shift by 4 inches verticall:
pscoast -R0/360/-70/70 -JM6.5i -Ba60f30 -G0 -Dc -P -Y4i > GMT mercator.ps &

%

'

$

Overlay and Continue modes
? If a GMT command is NOT THE LAST (in a script for instance), then it
must contain -K, meaning “more postscript code will be appended later”.

? If a GMT command is NOT THE FIRST, then it must contain -O,
meaning “this postscript code is an overlay on top of previous code.

? Therefore, in a GMT script:
– The ?rst command contains -K only – The last command contains -O only – All commands in between contain -O -K

&

%

'

$

Colors in GMT
? GMT allows you to use color and grey scales for drawing lines or ?lling
polygons (landmasses, symbols, etc.)

? For instance:
– Many GMT commands use -G to de?ne the ?ll color (e.g., pscoast for landmasses) – Many GMT commands use -W to de?ne the pen color (and width) for coastlines – –

pscoast uses -I to de?ne the pen color (and width) for rivers pscoast uses -S to de?ne the ?ll color for oceans and lakes.

? Colors are de?ned with numbers from 0 to 255 that give their intensity
&

%

'

$

Grey scale in GMT
? White is coded as 0 - Black is coded as 255 ? Anything between 0 and 255 is grey ? Example of black landmasses and grey coastlines:
pscoast -R0/360/-70/70 -JM6.5i -Ba60f30 -Dc -G0 -W4/200 -P > GMT mercator.ps

&

%

'

$

Colors in GMT
? Colors in GMT are de?ned as a mixture of 3 primary colors: Red /
Green / Blue (or R/G/B in short).

? The intensity of each of those 3 primary colors ranges from 0 (lowest
intensity) to 255 (highest intensity).

? For instance:
– Red is coded as 255/0/0 (full red, no green, no blue). – Yellow is a mixture of red and green, therefore de?ned as 255/255/0.

? The web link below provides a wide range of RGB color de?nitions:
http://stommel.tamu.edu/ baum/GMT/colors/colors.html

&

%

'

$

&

%

'

$

Other pen attributes
A pen in GMT has three attributes: width, color, and texture, speci?ed for instance with: -Wwidth[/color][ttexture][p]

? Width: measured in units of the current device resolution. Append p
to specify pen width in points (1/72 of an inch).

? Color: see above, gray shade or RGB. ? Texture:
– – –

to = dotted line ta = dashed line tstring:offset = string = length gap length gap, offset from origin

? Example: pscoast -R-140/-50/20/65 -JM6.5i -Ba20f5
-N1/2/255/0/0t20 10 5 10:10 -N2/2/0/to -W1/0/0/255 -P > GMT mercator.ps &

%

'

$

Plotting text strings
? GMT command is pstext ? Input data to pstext must contain:
x y size angle fontno justify text
– x y = location, in plot units – size = font size in points (e.g. 12) – angle = angle CCW from horizontal – fontno = font number (e.g. 0 for Helvetica) – justify = combination of LCM and TMB:

&

%

'

$

Plotting text strings: input data
As an external ?le: 1. Create or edit ?le with text data, for instance:

echo "-86 40 14 0 0 CM Purdue" >!

mytext.txt

2. Call pstext, for instance after a pscoast command:

pscoast -R-140/-50/20/65 -JM6.5i -Ba20f5 -N1/2/255/0/0ta -N2/2/0/to -W1/0/0/255 -P -K > GMT_mercator.ps pstext mytext.txt -R -JM -O >> GMT_mercator.ps

&

%

'

$

Plotting text strings: input data

&

%

'

$

Plotting text strings: input data
Directly: 1. By “piping” text into pstext:

echo "-86 40 14 0 0 CM Purdue" | pstext mytext.txt -R -JM -O >> GMT_mercator.ps
2. Using <<:

pstext << eof -R -JM -O >> GMT_mercator.ps -86 40 14 0 0 CM Purdue eof

&

%

'

$

Exercise
Plot a map of the continental US with the name of each state capital shown at its geographic location. Use ?le state capitals, awk,

pscoast,and pstext.

&

%


赞助商链接
相关文章:
GMTset参数
GMTset参数_电脑基础知识_IT/计算机_专业资料。3、默认参数 绘图介质参数: ? ? ? PAGE_COLOR = white #纸张的背景色,不能透明 PAGE_ORIENTATION = landscape...
全球时区_GMT_UTC_DST_CST_图文
全球时区_GMT_UTC_DST_CST - 1.全球时区划分 本初子午线是图中中间的那条粗紫色虚线,经度为 0 在西元 1884 年的国际会议上制定了全球性的标准时,明定以英国...
GMT绘时间序列及相分析的方法
GMT绘时间序列及相分析的方法 - GMT 绘时间序列及相分析的方法 具体步骤如下: 1 首先是准备好规则数据。如果数据格式是 matlab 处理和存储的矩阵格式,使用 ...
GMT小结
echo 120.0 90.0 >1.txt 把相关信息写入文本文档,以便直接在 gmt 命令流中修 改,并可在每次命令流的末端删除,免得文件内产生过多文件。 当然,我们也可以...
GMT模压工艺
GMT模压工艺_材料科学_工程科技_专业资料。GMT 模压工艺 ?GMT 工艺是在金属对合模中,将剪裁好的片状材料预热至基本熔点以上后,放入 金属对合模中,受高温高压...
UTC和GMT及北京时间的关系
UTC和GMT及北京时间的关系_建筑/土木_工程科技_专业资料。UTC和GMT及北京时间的关系 以下内容可帮助您了解 UTC 与 GMT 的定义、联系与区别、及与北京时间的换算...
复合塑料GMT、LFT、NMT介绍
复合塑料GMT、LFT、NMT介绍_能源/化工_工程科技_专业资料。复合塑料GMT、LFT、NMT介绍复合塑料 GMT、LFT、NMT 介绍 、、 时间: 时间:2010 年 5 月 玻璃纤维...
24时区,GMT,UTC,DST,CST时间详解
24 时区,GMT,UTC,DST,CST 时间详解 Eric 2011-04-27 10:34:22 全球 24 个时区的划分 相较于两地时间表,可以显示世界各时区时间和地名的世界时区表(World ...
GMT板材
GMT板材_材料科学_工程科技_专业资料。热压板材一种玻纤热塑料的预浸料 GMT 实际是一种玻纤热塑料的预浸料,类似热固性的 SMC,是玻纤和热塑性塑料预先制 成的半...
UTC GMT CST时间
UTC GMT CST 时间 GMT(Greenwich Mean Time,格林威治标准时间): 是指位于英国伦敦郊区的皇家格林尼治天文台的标准时间,因为 本初子午线被定义在通过那里的经线。 ...
更多相关标签: