gmt画网格点和笛卡尔坐标以及比例尺

标签:
画箭头和网格点 |
分类: GMT |
#!/bin/bash
gmtset PLOT_DEGREE_FORMAT ddd.x #设置坐标显示为度而不是度分秒
gmtset VECTOR_SHAPE 0.5
gmtset HEADER_FONT 35
R=116/119/30/32
#R=115/119/29/33
J=M5i
namegrd="anhui.grd"
cpt="cptfile_grids"
outps="anhui_grids.ps"
xlabel="longitude()"
ylabel="latitude()"
cptnew="anhui.cpt"
rm -rf *.ps
grdraster 10 -G${namegrd} -J${J} -R${R} -I1m
makecpt -C${cptnew}
-T0/1600/2 >${cpt}
#增加渲染程度,也就是表现地形的起伏程度,调参数-A和-N
grdgradient ${namegrd} -A323 -Ganhui.int -Ne1 -M
psbasemap -X4 -Y8 -R${R} -J${J}
-B0.5/0.5WSen -K
-P >> ${outps}
grdimage ${namegrd} -J${J} -R${R}
-B0.5/0.5WESN -C${cpt} -Ianhui.int
-E300 -O -K -P
>>${outps}
psscale -D14.5/5/8/0.3
-C${cpt} -I -B200::/:"m": -O -K
>>${outps}
awk '{print $3,$2}' ABCDE.txt | psxy -J${J} -R${R} -St0.2
-Gblack -Wblack -O -K -P >>${outps}
awk '{print $1,$2}' fault_china_2010.dat | psxy
-J${J} -R${R} -W2black -P -K -O
>>${outps}
# pscoast :
-Df画出流线性河流,增加分辨率,否则很锯齿,-I表示画多少级河流
pscoast -R${R} -J${J} -B0.5/0.5WeSn -Df
-I1/1p,red -Swhite -O -K -P
>> ${outps}
awk '{print $2,$1}' inversion_grid.dat | psxy -J${J} -R${R}
-S+0.3 -Gblue -Wthick,blue -O
-K -P >>${outps}
# plot the cart-coordinate symbol
#psxy : -Sv画坐标轴,也就是箭头,起点(X,Y),方向,长度
psxy -J${J} -R${R} -Sv -Ggray
-W1.0,gray -O -K
-P >>${outps} <<EOF
116.125
31.2658 0
10
117.125 30.3639
90 8
EOF
pstext -J${J} -R${R}
-Wblue -K -O -P >> ${outps}
<<EOF
117.3 31.95 8 0
0 cm
X=0km
118.6 31.3 8
0 0 cm
Y=0km
EOF
#画比例尺图标
pslegend -J${J} -R${R}
-D116.1/32./2.5c/1c/TL -L0.5 -K
-O >> ${outps} <<EOF
M 118 32 50+u f
EOF
#awk '{print $3+0.1,$2,8,0,1,"cm",$1}' source_txt.txt | pstext
-J${J} -R${R} -O -K -P
>>${outps}
awk '{print $3,$2}' source.txt | psxy -J${J} -R${R} -Sa0.4
-Gred -Wred -O -P
>>${outps}
ps2raster -A -Tt ${outps}
ps2pdf ${outps} anhui.pdf
gs ${outps}
#envince anhui.pdf
后一篇:GMT&pssac2画波形放大图