---
# System prepended metadata

title: GMT
tags: [GMT]

---

# GMT

makecpt -Cred,green,blue -T0,100,300,10000 > quake.cpt



pscoast -R130/150/35/50 -JM15c -Ba -BWSne -G160/160/160 -K > map.ps

![](https://i.imgur.com/ujoduBX.png)



---


gawk '{if(NR>2)print $5,$4,$7}' quakes.ngdc > quakes.d

pscoast -R130/150/35/50 -JM15c -Ba -BWSne -G160/160/160 -K > map.ps


psxy quakes.d -R -J -B -Sci -Wthinnest -O >> map1115.ps


gawk '{if(NR >2)print $5,$4,$7*0.03}' quakes.ngdc


pscoast -R130/150/35/50 -JM15c -Ba -BWSne -G160/160/160 -K > map.ps

psxy quakes.d -Cquakes.cpt -R130/150/30/50 -Ba -BWSne -JM15c -Sci -Wthinnest -O >> map.ps



---

pscoast -R130/150/35/50 -JM15c -Ba -BWSne -G160/160/160 -K > map.ps


psxy @tut_quakes.ngdc -R -J  -B -Wthinnest -i4,3,5,6+s0.1 -h3 -Scc -Cquake.cpt -O >>map.ps



![](https://i.imgur.com/t5sCWNH.png)



---

比例尺
pscoast -R130/150/35/50 -JM15c -Ba -BWSne -Lg135/49+w500+c130/35 -Gblue -K > map.ps

![](https://i.imgur.com/A36oBcl.png)


+f 比例尺樣式比較fancy
w500 : 比例尺大小


pscoast -R130/150/35/50 -JM15c -Ba -BWSne -Lg135/49+w500+c130/35+f -Gyellow -K > map.ps

![](https://i.imgur.com/tVMT6T9.png)


顯示單位 km
k

pscoast -R130/150/35/50 -JM15c -Ba -BWSne -Lg135/49+w500k+u+c130/35+f -Gyellow -K > map.ps


顯示單位 mile
M

pscoast -R130/150/35/50 -JM15c -Ba -BWSne -Lg135/49+w500M+u+c130/35+f -Gyellow -K > map.ps

![](https://i.imgur.com/pvMlHu7.png)



---
???
psxy 2.txt -R0/12/-3/3 -JX15c/5c -Sv0.1c/0.15c/0.12c -Bxa -Bya -BWSne -P > 2.ps
???


psxy 2.txt -R0/12/-3/3 -JX15c/5c -Sv0.1c/0.15c/0.12c -Bxa -Bya -BWSne -W0.25p,blue > 2.ps
![](https://i.imgur.com/vSIgF0j.png)



虛線dashed
psxy 2.txt -R0/12/-3/3 -JX15c/5c -Sv0.1c/0.15c/0.12c -Bxa -Bya -BWSne -W0.25p,blue,dashed > 2.ps
![](https://i.imgur.com/Jj7AJWD.png)

psxy 2.txt -R0/12/-3/3 -JX15c/5c -Sv0.07c/0.15c/0.12c -Ba -BWSne -W0.25p,blue -G67/180/55 > 2.ps
![](https://i.imgur.com/RcEjalk.png)


箭身寬度/箭頭/角度(東方為零度)/箭身長度

psxy 2.txt -R0/12/-3/3 -JX15c/5c -Sv0.07c/0.15c/0.12c -Ba -BWSne -W0.25p,blue -Gyellow > 2.ps
![](https://i.imgur.com/J5PUDk4.png)








cont.


psxy ecs_dv.txt -R116/134/23/41 -JM15c -Sv0.0085i/0.03i/0.015i -Ba -BWSne -G0 -P -K > ecs_dv.ps

![](https://i.imgur.com/qoTgLRz.png)


psxy ecs_dv.txt -R116/134/23/41 -JM15c -Sv0.0085i/0.03i/0.015i -Ba -BWSnw -Gred(裡面填紅色) -W0.5p,yellow(外框黃色) -P -K > ecs_dv.ps


psxy ecs_dv.txt -R116/134/23/41 -JM15c -Sv0.0085i/0.03i/0.015i -Ba -BWSnw -Gred -W0.5p,yellow -P -K > ecs_dv.ps


pscoast -R -J -B -Df -Gchocolate -W0.25p -O >> ecs_dv.ps

![](https://i.imgur.com/yIXM7hV.png)






## TEXT

pp.txt

1 1 30 0 7 BL It's P@ul, not pal!
1 2 30 0 4 BL Try @%33%ZapfChancery@%% today
1 3 30 0 4 BL @~D@~g@-b@- = 2@~pr@~G@~D@~h.
1 4 30 0 2 BL University of Hawaii at M@!a\305noa


pstext pp.txt -R0/7/0/5 -Jx1i -Bag -F+f30,Times-Roman,DarkOrange > 1.ps




![](https://i.imgur.com/nCjcu0k.png)




---


pscoast -R116/134/23/41 -JM7i -Di -Ba -BWSne -Ggray -W0.25p -P -K > map1206.ps
![](https://i.imgur.com/OJuJCjM.png)



加文字
128 36 26 0 4 CM KOREA
(位置)? (位置)? 文字大小 文字角度(旋轉) 字形 
pstext 1.txt -J -R -B -W0.25p -C0.01c/0.01c -G255 -O >> map1206.ps

![](https://i.imgur.com/qKbwTzP.png)




---
圖
pscoast -R116/134/23/41 -JM7i -Di -Ba -BWSne -Ggray -W0.25p -P -K > map1206.ps

加文字
改顏色
pstext 1.txt -J -R -B -W0.25p,green -C0.01c/0.01c -G255/0/0 -O >> map1206.ps


---

pscoast -R116/134/23/41 -JM7i -Di -Ba -BWSne -Ggray -W0.25p -P -K > map1206.ps


pstext 1.txt -J -R -B -F+f26,4,red -W0.25p,white -C0.01c/0.01c -G255/255/255 -O << EOF >>  map1206.ps
128 36 KOREA
EOF


![](https://i.imgur.com/0Zj8jLu.png)

---
最大300解析度/最大90樣式
F:前景色
B:背景色
:F[顏色]B[顏色]
pscoast -R116/134/23/41 -JM7i -Di -Ba -BWSne -Gp150/85:FblackByellow -W0.25p -P -K > map1206.ps

![](https://i.imgur.com/POv8mCa.png)

---

# 1207

grdcontour bermuda.nc -R294/300/30/35 -Ba -JM7i -C500 -A1000 -P > bermuda.ps

增加地圖外黑白框 : -Ba

![](https://i.imgur.com/iJRdUbe.png)

 nearneighbor ship.xyz -R245/255/20/30 -I5m -S40k -Gship.nc
grdcontour ship.nc -R245/255/20/30 -Ba -JM7i -C500 -A1000 -P > ship.ps
![](https://i.imgur.com/iLtw4z8.png)

---
grdcontour ship.nc -R245/255/20/30 -Ba -JM7i -C500 -A1000+f14 -P > ship.ps
![](https://i.imgur.com/gRJzDSI.png)




grdcontour ship.nc -R245/255/20/30 -Ba -BWSne -JM7i -Gd5c -C500 -A1000+f14,7,red -P -Q20 > ship.ps
,[字型Time Roman],[顏色]
![](https://i.imgur.com/8wlqSf7.png)



加單位
grdcontour ship.nc -R245/255/20/30 -Ba -BWSne -JM7i -Gd5c -C500 -A1000+f14,17,red+um -P -Q20 > ship.ps
![](https://i.imgur.com/Bj8usQT.png)


---


grdcontour ship2grid.nc -R245/255/20/30 -Ba -BWSne -JM7i -Gd5c -C500 -A1000+f14 -P > ship2grid.ps
![](https://i.imgur.com/IgbSvn0.png)





---
pscoast -R245/255/20/30 -JM7i -Di -Ba -BWSne -Ggray -W0.25p -P -K > map1207.ps

 grdcontour ship2grid.nc -R245/255/20/30 -Ba -BWSne -JM7i -Gd5c -C500 -A1000+f14 -P -O >> map1207.ps

![](https://i.imgur.com/g4U6PEi.png)


<font color="red" size=12px>
xyz2grd ship.xyz -R245/255/20/30 -I10m -Gship_2grd.nc</font>


---
上色

pscoast -R245/255/20/30 -JM7i -Di -Ba -BWSne -Ggray -W0.25p -P -K > ship_2grd.ps

 pscoast -R -J -B -Gchocolate -Di -W0.25p -O >> ship_2grd.ps 
 
 
 ![](https://i.imgur.com/uiZ6ofo.png)

 ---
 
  surface ship.xyz -R245/255/20/30 -I5m -Gship_sur.nc -T0.25


grdcontour ship_sur.nc -R245/255/20/30 -JM7i -C500 -A1000+f14 -Ba -BWSne -P -K > ship_sur.ps

 ![](https://i.imgur.com/cgjQo8W.png)


---
grdcontour ship_sur.nc -R -J -C500 -A1000+f14 -Q20 -O -K >> ship_sur.ps
 
psmask -C -O -K >> ship_sur.ps

pscoast -R -J -B -Gcyan -Di -W0.25p -O >> ship_sur.ps

![](https://i.imgur.com/T1suqnW.png)

---


---

# 1213

colorbar
![](https://i.imgur.com/wBylc3T.png)


---

makecpt -Crainbow -T-20/60/10 -Z > cont.cpt
psbasemap -R0/8.5/0/10 -JX8i -B0 -P -K > bar.ps
gmtset PROJ_LENGTH_UNIT inch
psbasemap -R0/8.5/0/10 -JX7 -B0 -P -K > bar.ps

psscale -Dx1/1+w5/0.3+h -Cdisc.cpt -Bxa10 -K -O >> bar.ps

psscale -Dx1/2.5+w5/0.3+h -Ccont.cpt -Bxa10 -K -O >> bar.ps

psscale -Dx1/4+w5/0.3+h -Cdisc.cpt -I0.8 -Bxa10 -K -O >> bar.ps

psscale -Dx1/5.5+w5/0.3+h -Ccont.cpt -I0.8 -Bxa10 -O >> bar.ps

---

gmtinfo ship.xyz


makecpt -Crainbow -T-7000/0/50 -Z > ship.cpt

blockmean ship.xyz -R245/255/20/30 -I5m > ship.sur

surface ship.sur -R245/255/20/30 -I2.5m -Gship.nc -T0.25


grdimage ship.nc -R245/255/20/30 -JM7i -Cship.cpt -K -P > topo.ps

pscoast -R -J -Di -Wthinnest -Ba -BWSne -G120 -K -O >> topo.ps


![](https://i.imgur.com/M8ZGlGO.png)


grdimage ship.nc -R245/255/20/30 -JM7i -Cship.cpt -K -P -X1.5i -Y2.1 > topo.ps

pscoast -R -J -Di -Wthinnest -Ba -BWSne -G120 -K -O >> topo.ps

psscale -Dx0/-0.8+w6i/0.2+h+e -Cship.cpt -I0.5 -Bx1000 -O -K >> topo.ps

![](https://i.imgur.com/QFjMxYZ.png)

# 1220

gmtinfo 檔名

makecpt -Crainbow -T-7000/-10/500 -Z > ship.cpt

blockmean ship.xyz -R245/255/20/30 -I5m >ship.sur

surface ship.sur -R245/255/20/30 -I5m -Gship.nc -T0.75

grdimage ship.nc -JM7i -R245/255/20/30 -Cship.cpt -K -P > ship.ps

grdimage ship.nc -JM7i -R245/255/20/30 -Baf -BWSne -Cship.cpt -K -P > ship.ps

pscoast -J -R -B+t"California bay" -Wthinnest -Dh -Ggray -K -O >> ship.ps

![](https://i.imgur.com/18vvnjB.png)

**colorbar**
psscale -Dx0/9i+w7/0.3+h+e -Cship.cpt -I0.4 -Bx2000 -By+lm -O -K>>ship.ps


psscale -Dx0/9i+w7/0.3+h+e -Cship.cpt -I0.4 -Bx1000g1000 -By+lm -O -K>>ship.ps
![](https://i.imgur.com/rEBKmwa.png)


---
---

grdgradient ship.nc -Ne0.8 -A100 -fg -Gship_i.nc

grdimage ship.nc -JM7i -R245/255/20/30 -Baf -Iship_i.nc -Cship.cpt -E300 -K -P > ship.ps

pscoast -J -R -BWSne+t"California bay" -Wthinnest -Dh -Ggray -K -O >> ship.ps

psscale -Dx0/9i+w7/0.3+h+e -Cship.cpt -I0.4 -Bx1000g1000 -By+lm -O -K>>ship.ps

![](https://i.imgur.com/tCWgdS6.png)

---
---

鹽度

gmtinfo s0w_1.txt

makecpt -Crainbow -T20/34.5/0.5 -Z > s.cpt

blockmode s0W_1.txt -R116/134/23/41 -I10m > s0w.sur

surface s0w.sur -R116/134/23/41 -I10m -Gs0w.nc -T0.25

grdimage s0w.nc -JM6i -R116/134/23/41 -Baf -BWSne+tsalinity -Cs.cpt -X1.5 -Y3 -K -P > s0w.ps

pscoast.exe -R -J -W0.25 -G122/122/122 -Di -B -K -O >> s0w.ps



---


grdimage.exe s0w.nc -JM6i -R116/134/23/41 -Baf -BWSne+tsalinitty -Cs.cpt -X1.5 -Y3 -K -P > s0w.ps

grdcontour.exe s0w.nc -R -J -B -C0.5 -A1+f14 -Gd5c -S5 -K -O >>s0w.ps

 pscoast.exe -R -J -W0.25 -G122/122/122 -Di -B -K -O >> s0w.ps


變不醜一點
grdimage.exe s0w.nc -JM6i -R116/134/23/41 -Baf -BWSne+tsalinitty -Cs.cpt -X1.5 -Y3 -K -P > s0w.ps

grdcontour.exe s0w.nc -R -J -B -L20/30 -C1 -Gd5c -S5 -K -O >>s0w.ps
![](https://i.imgur.com/graj7bk.png)

---
把黑色變紫色

gmtset COLOR_BACKGROUND purple

