新浪博客

GMT显示固定区域内容

2014-12-02 18:23阅读:
(博客不常在线,有问题可去微博留言提醒一下:http://weibo.com/u/2050475935/home?wvr=5
gmt中想要只显示部分区域的内容。首先必须要有区域的经纬度数据,以北京为例:
-------------------------------------------------
set mapname2='epicenter_beijingedge.ps'


set region2='-R115.25/117.6/39.4/41'
set proj2='-JB116.25/40.25/39/41/4i'
psbasemap %region2% %proj2% -Bf0.25a0.5:,'E':/f0.25a0.5:,'N':WeSn -K -P -Y3>%mapname2%
rem psclip裁剪,其后面的程序只在裁剪区域内绘图,直到遇见取消裁剪的命令为止!
psclip beijingedge.dat -R -JB -K -O -P>>%mapname2%
grdimage bj.grd -Ibj_i.grd -R -JB -B -Ccd.cpt -K -O -P >>%mapname
2%
pscoast -R -JB -B -A -Dh -P -I1/0.75p -W1 -O -K -Na/1.5p -S40/150/200>>%mapname2%
psxy southwestcity.dat -R -JB -Ss0.1 -O -G0/0/255 -K -P>>%mapname2%
psxy station.dat -R -JB -St0.1 -O -K -P -G0/0/255>>%mapname2%
psxy beijing.dat -R -JB -O -M -W1p/0/0/0 -K>>%mapname2%
psclip -C -O -K -P >>%mapname2%
rem 裁剪区被取消!!下面的程序就可以在整个绘图区域绘图了
psxy fault.dat -R -JB -O -M -W0.7p/200/0/0 -K>>%mapname2%
del gmt*
pause
----------------------------------------------------------
beijingedge.dat 数据部分如下:
----------------------------------------------------------
117.38004000, 40.21813600
117.37955000, 40.22451400
117.37301000, 40.22667700
117.36279000, 40.22690200
117.35005000, 40.22917600
117.34229000, 40.23234900
117.33687000, 40.23781600
117.33346000, 40.24395000
.
.
.
.
117.37213000, 40.19514100
117.37537000, 40.19981000
117.37968000, 40.20268600
117.38226000, 40.20575000
117.38255000, 40.20951500
117.38004000, 40.21813600(此行与第一行一样可以去掉)
----------------------------------------------------------
由上面代码可以看出 除 fault.dat 断层数据之外 其他都是在裁剪区域进行的,因此出图如下
GMT显示固定区域内容
上图只有断层出现在区域外,其他命令对应数据全部在北京区域之内。

我的更多文章

下载客户端阅读体验更佳

APP专享