#author("2024-04-23T14:10:01+09:00","default:Miyashita","Miyashita") #author("2024-04-23T14:11:33+09:00","default:Miyashita","Miyashita") *GMT -B オプション [#d2711894] #contents 共通オプション -B では,軸の目盛りとかラベルのインターバル,フォーマットを設定する.~ おそらく一番面倒かつ使用頻度の高いオプション.~ 数回のコマンド実行で1つの図を作成する場合には1回だけ詳細に記述すればよく,それ以外は -B の表記のみで問題ない.~ ~ **-Bafg (tick and grid spacing) [#iac20a86] ほぼ必ず使用する. a, f, g はそれぞれ,major tick, minor tick, grid を示し,それぞれに続く数値をもとに表示間隔が定められる.~ また,a は annotation (目盛りラベル)の表示も兼ねる.~ #codeprettify{{ # output file output="Bafg" # options proj=M12 region=-90/-30/-60/15 axes="-Ba15f15g15" # gmt6 gmt begin $output png gmt coast -J$proj -R$region $axes -W gmt end # gmt5 gmt pscoast -J$proj -R$region $axes -W -P > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/Bafg.png,340x460) 数値を入力せず -Bafg のようにすると,それぞれ適当と判断されたのもが指定される.~ grid を表示する必要がなければ,単純に -Baf のようにして g を書かなければ良い.a,fについても同じ.~ ~ **-Bafg (対数スケール) [#mb35577b] 片対数,両対数軸の場合は,spacing の数値の与え方が特殊なので注意する.~ 1,2,3 と数を増やすほど spacing が細かくなる.~ annotation については,数値の後にpを入れると10^{n}表記になる. #codeprettify{{ ## log scale # output file output="Bafg_logp" # options proj=X10l/5l region=1e0/1e5/1e-1/1e2 axes1="-Ba1pf2g3" axes2="-Ba1f2g3" # gmt6 gmt begin $output png gmt basemap -J$proj -R$region $axes1 gmt basemap -J$proj -R$region $axes2 -X11.5 gmt end }} &ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/Bafg_log.png,415x275); &ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/Bafg_logp.png,420x278); ~ **-Bxafg -Byafg (横軸,縦軸で別々の設定) [#icdb1fdf] Bの後に x, y と指定してそれぞれ横軸,縦軸個別に設定する. #codeprettify{{ ## 横軸と縦軸別々の設定 -Bxafg -Byafg # output file output="BxafgByxfg" # options proj=X12/6 region=0/100/0/10 axes="-Bxa20g20 -Bya2f1" # gmt6 gmt begin $output png gmt basemap -J$proj -R$region $axes gmt end # gmt5 gmt psbasemap -J$proj -R$region $axes -P > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/BxafgByxfg.png,402x216) ~ **-Bpafg -Bsafg (primary, secondary axes) [#xaba389c] primary (主)の目盛りと secondary (副)の目盛りをそれぞれ指定する.~ この p, s の指定がなければ通常は primary のことを指している.~ これを付す場所は,B の後かつ x, y の前でなければならない.~ 下図のように,デフォルトでは secondary の方が大きいフォントサイズであり,外側に位置している. #codeprettify{{ ## primary and secondary axes # output file output="BxpBxsBys" # options proj=X12/6 region=0/100/0/10 axes="-Bsxa20g20 -Bpxa10g10 -Bsya2f1 -Bpya1" # gmt6 gmt begin $output png gmt basemap -J$proj -R$region $axes gmt end # gmt5 gmt psbasemap -J$proj -R$region $axes -P > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/Bps.png,430x247) ~ **-B+l (軸ラベル) [#la866f69] 軸にラベルを付して,軸の説明するときに. #codeprettify{{ ## 軸ラベルをつける # output file output="Bafg_l" # options proj=X12/6 region=0/100/0/10 axes="-Bxa20g20+lx-axis -Bya2f1+ly-axis" # gmt6 gmt begin $output png gmt basemap -J$proj -R$region $axes gmt end # gmt5 gmt psbasemap -J$proj -R$region $axes -P > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/Bafg+l.png,448x256) ~ **-BNESW (annotationなどを表示する軸の設定) [#va54e11e] 地図でない数値グラフでは,基本的に軸ラベルは片側さえあれば良い.~ 方角の N,S,E,W でそれぞれ表示する軸を決める.~ 大文字(NESW)を挿入した場合は全て,小文字(nesw)の場合は目盛りの spacing だけ反映し annotation やラベルは表示しない.~ また,この4つはどのような順番で配置しても良い. #codeprettify{{ ## 片方の軸だけannotationをつける -BSWne # output file output="BNESW" # options proj=M10 region=120/155/20/50 axes1="-Ba5f5g5 -BneSW" axes2="-Ba5f5g5 -BSW" # gmt6 gmt begin $output png gmt coast -J$proj -R$region $axes1 -W gmt coast -J$proj -R$region $axes2 -W -X11.5 gmt end }} &ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/BneSW.png,394x403); &ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/BSW.png,394x403); ~ ~ **-Bzafg -BZ (3次元図での鉛直軸設定) [#k021b359] 上記の組み合わせで,3次元図の鉛直軸も設定できる.~ ただし,鉛直軸の場合は -B[N|S|E|W]Z を指定しないと -Bzafg が反映されないので注意.~ また,-BZ+b とすることで plotbox 全体を線で囲むことができる. #codeprettify{{ ## 3次元図でZ軸につける -Bzafg ## 3次元図でZ軸に表示する-BSWneZ # output file output="BNEswZ" # options proj=X10 projZ=Z8 region=0/100/0/10/-5/5 # -BZをつけないと表示されない # +bでplotboxを囲む axes="-Bxa20g20+lX -Bya2f1g2+lY -Bza5f1+lZ -BNEswZ+b" view=30/25 # gmt6 gmt begin $output png gmt basemap -J$proj -R$region $axes -J$projZ -p$view gmt end # gmt5 gmt psbasemap -J$proj -R$region $axes -P -J$projZ -p$view > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/BNEswZ+b.png,449x394) ~ **-B+t (図のタイトル) [#r49d0c74] 図の上部にタイトルを表示する. #codeprettify{{ ## タイトルをつける -BneSW+ttitle # output file output="BneSW_ttitle" # options proj=M12 region=120/155/20/50 axes="-Ba5f5g5 -BneSW+tTitle" # gmt6 gmt begin $output png gmt coast -J$proj -R$region $axes -W gmt end # gmt5 gmt pscoast -J$proj -R$region $axes -W -P > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/BneSW+ttitle.png,394x453) ~ **-B+gfill (背景色の設定) [#pad642fd] g の後に色を指定することで,背景色をつけることができる. #codeprettify{{ # 背景の着色 -BSWne+gfill # output file output="B_gfill" # options proj=X12/6 region=0/100/0/10 axes="-Bxa20g20+lX -Bya2f1+lY -BneSW+glightblue" # gmt6 gmt begin $output png gmt basemap -J$proj -R$region $axes gmt end # gmt5 gmt psbasemap -J$proj -R$region $axes -P > "${output}_gmt5.ps" gmt psconvert -Tg -A "${output}_gmt5.ps" }} #ref(https://main-t-miyashita.ssl-lolipop.jp/hydrocoast/image/GMT/B+gfill.png,409x223) ~ ***参考 [#ycbfe165] -[[GMT documentation>https://docs.generic-mapping-tools.org/latest/gmt.html#b-full]]