GMT画图示例

GMT鹰眼图画图示例

#!/bin/bash
gmtset HEADER_FONT_SIZE 30 OBLIQUE_ANOTATION 0 DEGREE_FORMAT 0
gmtset LABEL_FONT_SIZE 12P
ps=QHDLGamitPLOT.ps

#-k开始 -0结束 -p开始绘图第一次用 -B第一次用绘制边框 -v判断每个命令正确 -T忽略所有输入命令
#调试 V = -V #调试结束 #V= #第一个命令使用>创建文件写入ps,余下所有命令使用>>追加新的ps命令
#psclip 裁剪区域 #grdcut/grd2cpt/grdgradient绘制DEM底图 #加载topo底图
#psxy 加载点位坐标 #pstext显示名称 #psscale绘制坐标轴 #ps2raster绘制PDF

#绘制DEM底图/绘制中国区域大图(底图)
psbasemap -R60/150/20/55/ -JM10 -Ba0.2f0.5/a0.2f0.5 -K -P >> $ps 
grdcut /home/tuteng/桌面/topo15/topo15.grd -R60/150/20/55/ -Gout.grd -V
grd2cpt -CGMT_topo.cpt -V out.grd > QHDLGamitPLOT.txt.cpt
grdgradient out.grd -A200 -Do -Ne0.6 -Gout.grd.int
psclip QHDLGamitPLOT.txt -R -J -K -O >>$ps
grdimage out.grd -JM10 -R60/150/20/55/ -Ba0.2f0.5/a0.2f0.5  -CQHDLGamitPLOT.txt.cpt -Iout.grd.int -K -P -O >>$ps 
pscoast -JM10 -R60/150/20/55/ -Dh -A3000 -S100/100/250 -W1  -Na -K -O>>$ps
#psxy QHDLGamitPLOT.txt.txt -R101.61/103.12/35.41/37.18 -JM10 -Sc0.1 -Gred -W0.1p -O -V -K >>$ps
psxy QHDLGamitPLOT.txt -R60/150/20/55/ -JM10 -W2 -O -V -K >> $ps
psxy QHDLGamitPLOT.txt -R60/150/20/55/  -JM10 -Sc0.01 -Gred -W2 -O -V -K >> $ps
psclip -C -R -J -O  -P -K >>$ps
psxy ldylfw.txt -R60/150/20/55/ -JM10 -Sc0.01 -Gred -W1p -O  -V -K >>$ps
pstext -R -J -Gred -N -O -K  <<ENDD  >>$ps
102.30 36.4 18 0 1 1
ENDD
psscale -D4.5i/1.5i/6c/0.3c  -B800:QHDLGamitPLOT.txt:/:m: -CQHDLGamitPLOT.txt.cpt -E -O -K >> $ps

#绘制DEM底图/绘制应急灾区小图 
gmtset LABEL_FONT_SIZE 1P
psbasemap -R102.3668/102.4053/36.4904/36.5156 -JM5 -Ba0.05f2.5/a0.05f2.5 -K -P -X8.5 -Y9 -O >> $ps
grdcut /home/tuteng/桌面/topo15/topo15.grd -R102.3668/102.4053/36.4904/36.5156 -Gout.grd -V
grd2cpt -CGMT_topo.cpt -V out.grd > QHDLGamitPLOT.cpt
grdgradient out.grd -A200 -Do -Ne0.6 -Gout.grd.int
#psclip ldylfw.txt -R -J -K -O >>$ps
grdimage out.grd -JM5 -R102.3668/102.4053/36.4904/36.5156 -Ba0.05f2.5/a0.05f2.5  -CQHDLGamitPLOT.cpt -Iout.grd.int -K -P -O >>$ps
pscoast -JM5 -R102.3668/102.4053/36.4904/36.5156 -Dh -A3000 -S100/100/250 -W0.1p  -Na -K -O>>$ps
psxy ldylfw.txt -R102.3668/102.4053/36.4904/36.5156 -JM5 -Sc0.15 -Gred -W0.01p -O -V -K >>$ps
#psclip -C -R -J -O  -P -K >>$ps
psscale -D4.5i/1.5i/3c/0.3c  -B50:QingH:/:m: -CQHDLGamitPLOT.cpt -E -O  >> $ps

#export pdf
ps2raster -A -P -Tf $ps
rm -f gmt.confe

在这里插入图片描述

发布了29 篇原创文章 · 获赞 5 · 访问量 1452

猜你喜欢

转载自blog.csdn.net/u011322358/article/details/104255176