1.软件: 下载 GMT6.1(GMT中文社区)
2.地形起伏数据下载: GMT地形起伏数据 中科大镜像
(1). Linux 或 macOS 用户将数据文件放在目录 ~/.gmt/server 下(若目录不存在则新建)
(2). Windows 用户将数据文件放在 C:\Users\用户名.gmt\server 目录下(若目录不存在则新建),详见earth_relief: 全球地形起伏数据(GMT6.0中文手册.pdf ,282页11.4.1 地形起伏数据简介)
3. 将以下命令复制进txt,关闭并保存。
4. txt文档后缀改为bat,双击运行。图片自动保存在当前工作目录。
gmt begin global_relief png
gmt grdimage earth_relief_30s.grd -JQ20c -R130/160/-45/25 -BWSEN -Baf -I+d
REM 绘制地形起伏 J投影并设置图片宽度 I光照效果
gmt plot 1_1.txt -St0.5c -Wthinner,red -Gred
gmt plot 2_2.txt -Sc0.2c -Wthinner,green -Ggreen
REM 绘制台站 Sc圆形0.1直径 W画笔宽度0.5 G填充红色
gmt text 1.txt -F+f15p,1,red+a30 -D-0.8c/-0.15c
gmt text 2.txt -F+f15p,1,green+a30 -D1.2c/0.30c
gmt text robi.txt -F+f15p,1,red+a30 -D-0.8c/-0.55c
REM 添加标注-F+ffont 可以设置文字的属性,包括文字大小、字体和颜色,三者之间用逗号分隔。-F+a 则可以设置文字的旋转角度。 -D设置文字偏移量
REM S dx1 symbol size fill pen dx2 text 添加图例
echo S 0.5c t 0.3c red 0.2p,red 1c Air Quality Monitoring Station > tmd.dat
echo S 0.5c c 0.3c green 0.2p,green 1c GPS Station >> tmd.dat
gmt legend tmd.dat -DjBR+w6.8c+o12.5c/15c -F+p0.5p
gmt end show
5.台站及标注数据格式:
经度 纬度 名称
153.2665 -28.077 clev
150.9137 -34.4756 ptkl
151.1504 -33.7809 sydn
138.4857 -35.0947 ptsv
145.2140 -38.3752 stny
147.9308 -42.5464 spby
6.成图:
参考:
GMT中文社区 GMT6.0 中文手册