GMT grdimage - doesn't create imagine

Hi everyone,

I have a file that contains 3 columns: longitude, latitude and a height.
I would like to create a plot that is colored based on the height of the point that is contained in the file.
I have used the following commend:

gmt xyz2grd coord_blh.longlat.txt -D+xdegree+ydegree+zGal $LIMS $PROJ -I30s
gmt grd2cpt $LIMS -Crainbow -T-0.01/2.1/0.02 -Z > soso.cpt
gmt grdimage $LIMS $PROJ -Csoso.cpt -Q -K > $PSFILE
gmt grdcontour -C30 $PROJ $LIMS -Wdarkgray -A- -K -O >> $PSFILE
gmt pscoast $PROJ $LIMS -Bx10 -By4 -W -Di -Ir -N1 -K -O -P >> $PSFILE
gmt psscale -D1.5i/1.5i+w2.5i/0.25i+h+jCT+m -Csoso.cpt -B0.5+l"Height Diff (cm)" -O >> $PSFILE

but unfortunately my plot is just grey - as if it doesn’t consider the grdimage command an the colors that should be in the soso.cpt file.
I’m doing something wrong but I don’t know what.
Thank you for the support in advance.


coord_blh.longlat.txt (3.5 KB) .

No miracles, your data is not interpolated so xyz2grd cannot work. Must use one of the GMT interpolaters first (e.g. surface or triangulate or others) first to create one grid.

Hi Joaquim,

Thank you very much. Using both interpolates works - surface and triangulate.


1 Like