|||
本例的脚本和数据文件会在下方提供下载,可根据类似格式和熟读脚本写出你想要的时间序列图,当然matlab可以搞定的,但是既然选择了GMT就要尽量多熟练掌握她的应用吧,GMT == give u surprises in any time, as u know。
NOTE: 如果有更好的建议或者改进请及时通知原作者 zhouforme@gmail.com。
脚本:
#!/bin/bash
#
# Purpose:Plot residuals
# Author : Feng Zhou
# Date : 2013-05-31
#
outps=ats_resi.eps
ORI="-P"
# plot North
# plot a line on zero
psxy <<! -R2001.5/2007.5/-10/10 -JX16.0/7.0 -X2.0 -Y16.7 -K $ORI -W1/200/200/200 -V \
-Ba1.0f0.5/a2.0f1.0sWne > $outps
2001.50 0.00
2007.50 0.00
!
# plot ats residual : red line
cat $1 | grep -v "\*" | awk '{print $1, $3, 0.1}' | \
psxy -R -J -K -O $ORI -W2/255/0/0 -V >> $outps
# put text
pstext <<! -H0 -JX -R -O -K -V $ORI >> $outps
2001.75 -8 13 0 1 1 N(mm)
!
# plot East
# plot a line on zero
psxy <<! -R2001.5/2007.5/-10/10 -JX16.0/7.0 -X0.0 -Y-7.0 -O -K $ORI -W1/200/200/200 -V \
-Ba1.0f0.5/a2.0f1.0sWne >> $outps
2001.50 0.00
2007.50 0.00
!
# plot ats residual : red line
cat $1 | grep -v "\*" | awk '{print $1, $2, 0.1}' | \
psxy -R -J -K -O $ORI -W2/0/255/0 -V >> $outps
# put text
pstext <<! -H0 -JX -R -O -K -V $ORI >> $outps
2001.75 -8 13 0 1 1 E(mm)
!
# plot Up
# plot a line on zero
psxy <<! -R2001.5/2007.5/-30/30 -JX16.0/7.0 -X0.0 -Y-7.0 -K -O $ORI -W1/200/200/200 -V \
-Ba1.0f0.5/a5.0f2.5SWne >> $outps
2001.50 0.00
2007.50 0.00
!
# plot ats residual : red line
cat $1 | grep -v "\*" | awk '{print $1, $7, 0.1}' | \
psxy -R -J -K -O $ORI -W2/0/0/255 -V >> $outps
# put text
pstext <<! -H0 -JX -R -O -V $ORI >> $outps
2001.75 -25 13 0 1 1 U(mm)
!
# Convert EPS to PNG
ps2raster $outps -A -P -Tg
# Clean up after ourselves:
rm -f .gmt*
效果图:
脚本和数据文件附件:
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-28 03:25
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社