#!/bin/bash # GMT plotting script used by "dispGrid_dataBased_uptodate.com" # and used by "dispGrid_dataBased_uptodate_up.com" # Compatible with both GMT5 and GMT6 # Used to create: # Cumulative Transient (E/N) Plots # Weekly Transient (E/N) Plots # Displacement Grid (E/N) Plots # Displacement Grid (Up) Plots #Edited by Lavoisiane, August 2024, due the different in the servers # Set GMT defaults #gmt gmtset FONT_ANNOT_PRIMARY 8p,Helvetica #gmt gmtset MAP_FRAME_PEN thinner,black # Requires 12 inputs: # example: ./plot_Lat_Long.com ${mapminlon} ${mapmaxlon} ${mapminlat} ${mapmaxlat} 0.65 transientNgrid_$yymmdd 50 transientNcolors "ResN(mm)-$yymmdd" $transient_text_lon $transient_text_lat $map_text_size # $1 = min longitude, $2 = max longitude, $3 = min latitude, $4 = max latitude # $5 = Mercator map projection scale, $6 = Name of Map file, $7 = Scale units # $8 = Colorpalette name, $9 = Scale label, $10 = latitide of legend placement # $11 = longitude of legend placement, $12 = size of legend ### MAP NAME map="$6.ps" ### DEFINE MAP GRID & BACKGROUND gmt psbasemap -Jm$5 -R$1/$2/$3/$4 -Ba2f1g0WSen -K -Yc -Xc -P -V > $map gmt pscoast -Jm$5 -R -Na -W0.5 -Gwhite -Dh -O -K -V >> $map ### PLOT INTERPOLATED SURFACE GRID gmt grdimage $6.grd -C$8.cpt -Jm$5 -R -O -K -V >> $map ### PLOT FAULT LINES & FINAL COASTLINES gmt psxy cafaults.xy -Jm$5 -R$1/$2/$3/$4 -W0.25p -Vw -K -O >> $map gmt psxy LateQuaternary.xy -Jm$5 -R$1/$2/$3/$4 -W0.25p -Vw -K -O >> $map gmt psxy Holocene_LatestPleistocene.xy -Jm$5 -R$1/$2/$3/$4 -W0.25p -Vw -K -O >> $map gmt pscoast -Jm$5 -R -Na -S200/200/200 -W0.5 -Dh -O -K -Vw >> $map ### PLOT A SCALE #gmt psscale -C$8.cpt -Dx0.4c/1c+w3.7c/0.3c+jTL+h -B$7+A+l" " -O -I -V -K >> $map gmt psscale -C$8.cpt -Dx0.4c/1c+w3.7c/0.3c+jTL+h -B$7+A+l" " --FONT_ANNOT_PRIMARY=6p,Helvetica --MAP_ANNOT_OFFSET_PRIMARY=2p -O -I -V -K >> $map ### CREATE A LEGEND gmt pstext -R -Jm -N -O -V -F+f10,black+j << EOF >> $map # legend title position, size, text (does not apply to dn/e_res_tot uncn/ez) ${10} ${11} ${12} ${9} EOF ### CONVERT .ps FILE TO .pdf gmt psconvert $map -A -Tf ### REMOVE .ps FILE TO CLEANUP rm $map #--- OLD COMMANDS JUST IN CASE # gmt psscale -C$8.cpt -Dx1c/2.1c+w5c/0.5c+jTL+h -B$7+A+l"(mm)" -O -I -V -K >> $map # -dx(left/right)/(up/down) +w(width)c/heightc # gmt pstext -R -Jm -N -O -V -F+f18,black+j << EOF >> $map #gmt psxy cafaults.xy -Jm$5 -R$1/$2/$3/$4 -Sc0.01 -V -K -O >> $map #gmt psxy LateQuaternary.xy -Jm$5 -R$1/$2/$3/$4 -Sc0.005 -V -K -O >> $map #gmt psxy Holocene_LatestPleistocene.xy -Jm$5 -R$1/$2/$3/$4 -Sc0.005 -V -K -O >> $map