Taiwan

[GMT] 將地圖座標標籤(tick)繪製在地圖內

跟大家分享個小小的技巧,就是將GMT繪製的地圖座標的標籤繪製在地圖內側。這用其他GIS軟體非常容易,GMT的話其實也只要增加兩個設定即可。

這邊需要設定一些 gmt 的變數:MAP_TICK_LENGTH 與 MAP_ANNOT_OFFSET,將兩變數的長度值設為負數,即可將標籤與標記設定在地圖的內側。

繪圖指令(batch)

在這邊我們用 –Parameter=Value 的設定方式,在有 -B (畫地圖外框的選項)的命令加上 「–MAP_TICK_LENGTH=-6p/-2.5p –MAP_ANNOT_OFFSET=-7p」兩項變數即可。

註解:「^」是 batch 中表示命令未完,下一行繼續的符號,在 shell 使用反斜線(\)接換行即可。

參考結果

Taiwan
台灣海岸線圖

參考 gmt.conf 的說明:

MAP_TICK_LENGTH
Sets both MAP_TICK_LENGTH_PRIMARY and MAP_TICK_LENGTH_SECONDARY to the value specified. This setting is not included in the gmt.conf file.

MAP_TICK_LENGTH_PRIMARY
The length of a primary major/minor tick-marks [5p/2.5p]. If only the first value is set, the second is assumed to be 50% of the first.

MAP_TICK_LENGTH_SECONDARY
The length of a secondary major/minor tick-marks [15p/3.75p]. If only the first value is set, the second is assumed to be 25% of the first.
MAP_ANNOT_OFFSET
Sets both MAP_ANNOT_OFFSET_PRIMARY and MAP_ANNOT_OFFSET_SECONDARY to the value specified. This setting is not included in the gmt.conf file.

MAP_ANNOT_OFFSET_PRIMARY
Distance from end of tick-mark to start of annotation [5p].

MAP_ANNOT_OFFSET_SECONDARY
Distance from base of primary annotation to the top of the secondary annotation [5p] (Only applies to time axes with both primary and secondary annotations).

連結

  1. GMT conf 網頁:http://gmt.soest.hawaii.edu/doc/latest/gmt.conf.html

請多多指教!

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料