How to color line segments according z-value?

Thank you @pwessel! gmt convert and -Sv+s -W+cl did the trick. Great idea converting the segments to vectors.

track_sample_data.txt (19.6 KB)

#!/usr/bin/env bash

gmt makecpt -T0/20000 -Cseis > track.cpt
gmt convert track_sample_data.txt -i7,6,3 -Fv -o0,1,3,4,2 > trackv.txt

gmt begin track_sample
  gmt plot \
    -R007:24:13.64/49:01:59.90/009:54:13.64/51:01:59.90r \
    -JL008:34:13.64/50:01:59.90/49:31:59.90/50:31:59.90/20c \
    trackv.txt -Sv1p+s -W2p+cl -Ctrack.cpt -i0,1,4,2,3
gmt end 

Just some eye-candy with more tracks:

The idea @PlanetGus brought up with just plotting symbols and colouring them via z-value is quite clever as well. While not ideal in this case it is a useful trick to know. Thank you for that!

2 Likes