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

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与UTC的区别
GMT与UTC的区别_机械/仪表_工程科技_专业资料。GMT和UTC,两个不同的概念,却是很容易混淆的定义。GMT 和 UTC 的区别 GMT(Greenwich Mean Time)——格林尼治...
GMT之底图边框类型
GMT之底图边框类型_计算机软件及应用_IT/计算机_专业资料。BASEMAP_TYPE 是 GMT 的默认参数中可以修改的一个,其可以取 inside、graph、plain 和 fancy 中的任意...
GMT_绘图-整理-入门-夏少波
12 一、GMT 安装 http://gmt.soest.hawaii.edu/ 进去后点击 DOWNLOAD 在 Platform-specific Instructions 进行平台选择, Windows 下, GMT Windows 下进入下载界面...
mysql游标嵌套
(3), gmt_create date, gmt_modified date ); drop table if exists `tb_user_param`; create table tb_user_param ( id bigint(22) not null auto_...
GMT
GMT_机械/仪表_工程科技_专业资料。玻纤毡增强热塑性片材(Glassfiber Mat Thermo-plastic简称GMT)GMT 技术及其在汽车领域的应用 1 前言 热塑性树脂基复合材料近年...
GMT小结
echo 120.0 90.0 >1.txt 把相关信息写入文本文档,以便直接在 gmt 命令流中修 改,并可在每次命令流的末端删除,免得文件内产生过多文件。 当然,我们也可以...
GMT简介
GMT简介_材料科学_工程科技_专业资料。GMT 简介 GMT 是什么? GMT 是一款地学绘图软件,由美国哥伦比亚大学地球观测所的两名研究生 Paul Wessel 和 Walter H. F...
mysql游标嵌套
(3), gmt_create date, gmt_modified date ); drop table if exists `tb_user_param`; create table tb_user_param ( id bigint(22) not null auto_...
GMT板材
GMT板材_材料科学_工程科技_专业资料。热压板材一种玻纤热塑料的预浸料 GMT 实际是一种玻纤热塑料的预浸料,类似热固性的 SMC,是玻纤和热塑性塑料预先制 成的半...
GMT安装
可试运行 e:\gmt\win4g\WIN4GMT.exe 编者注: 因为 GMT 在 Windows 下采用执行批处理文件的方法来运行, 建立和编辑批处理文件是主要的 过程。 因此, 建议的...
更多相关标签:
gmt时间 | gmt地弹簧 | gmt+8 | gmt utc | gmt是什么意思 | gmt官网 | gmt时间和北京时间 | 格林威治时间 |