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

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.

&

%


相关文章:
GMT板材
GMT板材_材料科学_工程科技_专业资料。热压板材一种玻纤热塑料的预浸料 GMT 实际是一种玻纤热塑料的预浸料,类似热固性的 SMC,是玻纤和热塑性塑料预先制 成的半...
GMT安装
可试运行 e:\gmt\win4g\WIN4GMT.exe 编者注: 因为 GMT 在 Windows 下采用执行批处理文件的方法来运行, 建立和编辑批处理文件是主要的 过程。 因此, 建议的...
GMT笔记-GMT常用画图等命令
2.> pscoast GMT 画陆块海洋和海岸线的程序 一定要有的参数 -J 投影法,和前面的一样 -R 地图的经纬度范围,和前面的一样 不一定要有的参数 -E 旋转地图...
GMT简介
GMT简介_生活休闲。GMT 简介 1.材料 玻璃纤维毡增强热塑性片材 (GMT , Glass MatReinforced Thermoplastics)是 20 世纪 80 年代发展起来的一种新材GMT 简介 ...
GMT 的历史
GMT 的历史_自然科学_专业资料。GMT 的历史默认分类 2007-08-21 14:49:14 阅读 162 评论 2 字号:大中小 订阅 何为 GMT?GMT 在国外的运用情况怎么样? ...
GMT笔记-GMT常用画图等命令
psbasemap GMT 画底图的指令 一定要有的参数 -B 设定图边界尺标的间隔 a 文字批注的间隔 f 边框标记的间隔 g 隔线的间隔 如果要针对 X 轴或 Y 轴做不同...
gmt中文帮助手册
第九章 通用地学制图工具 GMT 入门简介:GMT 通用地学绘图软件已经在地理、地球物理等学科得到广泛应用。作为一个共享软件,不存在 版权问题。本章对于 GMT 的介绍...
UTC GMT CST时间
UTC GMT CST 时间 GMT(Greenwich Mean Time,格林威治标准时间): 是指位于英国伦敦郊区的皇家格林尼治天文台的标准时间,因为 本初子午线被定义在通过那里的经线。 ...
GMT材料与其他材料性能比较
GMT材料与其他材料性能比较_机械/仪表_工程科技_专业资料。GMT材料与其他材料性能的一些简单比较 ? GMT与SMC对比的优点 1、 容易回收、再生,可重复使用 GMT材料...
UTC和GMT及北京时间的关系
UTC和GMT及北京时间的关系_建筑/土木_工程科技_专业资料。UTC和GMT及北京时间的关系 以下内容可帮助您了解 UTC 与 GMT 的定义、联系与区别、及与北京时间的换算...
更多相关标签: