#!/usr/bin/env bash
#	Test pstext laying down clip path for text boxes, then contour, then show texts

ps=cliptxtbox.ps
gmt pstext -R-74.25/-63.75/-44.0/-39.5 -JB-69/-41.75/-40.625/-42.875/6i \
	-Ba1 -F+a0+j+f10p,Helvetica,black -DJ0.5c -C0.2c -Gc -K -P > $ps << EOF
#> -Sa0.5c -Gred -Wthick,red,solid
-109.3832917 -27.14820833 BC EISL
-9.880716667 -40.34883333 BC GOUG
-109.3444139 -27.12498333 BC ISPA
-57.9323 -34.90674444 BC LPGS
-57.90133333 -63.32108056 BC OHI2
-57.90033889 -63.32072222 BC OHIG
-64.051125 -64.77509167 BC PALM
-67.75111944 -53.78547222 BC RIOG
-67.75111944 -53.78547222 BC RIO2
-68.41781389 -41.08705000 ML AGUA
-67.95687778 -42.85306667 ML BAJO
-69.49531389 -42.04005278 BC CALC
-65.79744444 -40.86326667 MR CECI
-68.10059444 -42.61146944 TR CHAC
-65.51015556 -41.60950556 MR CONA
-66.05875278 -40.45367778 TL DURO
-69.34635 -42.27547500 ML GAST
-68.17500556 -42.37175278 BC GANG
-69.38011667 -41.60036944 ML JACO
-66.52473889 -40.54313611 MR NAHU
#> -St0.5c -Gyellow -Wthick,black,solid
-70.66855556 -33.15028889 BC SANT
-68.05017778 -41.70413611 ML CAIN
-71.41349722 -41.13214167 TL BARI
-70.63212778 -40.24942500 ML CEPI
-70.21755278 -41.03626111 ML COMA
-71.40435 -42.14046944 TL EPUY
-65.37825 -43.26430556 MR TREL
-70.05505556 -38.83600000 BC LAAM
-70.31449722 -37.36082778 BC CHOS
-70.31449722 -37.36082778 BC ELCH
EOF
gmt grdcontour test.grd -R -J -C500 -K -O >> $ps
gmt psclip -R -J -C -O -K -V >> $ps
gmt psxy -R -J -Sa0.5c -Gred -Wthick,red,solid -O >> $ps << EOF
> -Sa0.5c -Gred -Wthick,red,solid
-109.3832917 -27.14820833 BC EISL
-9.880716667 -40.34883333 BC GOUG
-109.3444139 -27.12498333 BC ISPA
-57.9323 -34.90674444 BC LPGS
-57.90133333 -63.32108056 BC OHI2
-57.90033889 -63.32072222 BC OHIG
-64.051125 -64.77509167 BC PALM
-67.75111944 -53.78547222 BC RIOG
-67.75111944 -53.78547222 BC RIO2
-68.41781389 -41.08705000 ML AGUA
-67.95687778 -42.85306667 ML BAJO
-69.49531389 -42.04005278 BC CALC
-65.79744444 -40.86326667 MR CECI
-68.10059444 -42.61146944 TR CHAC
-65.51015556 -41.60950556 MR CONA
-66.05875278 -40.45367778 TL DURO
-69.34635 -42.27547500 ML GAST
-68.17500556 -42.37175278 BC GANG
-69.38011667 -41.60036944 ML JACO
-66.52473889 -40.54313611 MR NAHU
> -St0.5c -Gyellow -Wthick,black,solid
-70.66855556 -33.15028889 BC SANT
-68.05017778 -41.70413611 ML CAIN
-71.41349722 -41.13214167 TL BARI
-70.63212778 -40.24942500 ML CEPI
-70.21755278 -41.03626111 ML COMA
-71.40435 -42.14046944 TL EPUY
-65.37825 -43.26430556 MR TREL
-70.05505556 -38.83600000 BC LAAM
-70.31449722 -37.36082778 BC CHOS
-70.31449722 -37.36082778 BC ELCH
EOF
