Color scale

I am using GMT6.4.0. I could successfully plot colored points according to rgb color palette.

My result is below.

My problem is when I am trying to insert the color scale. The figure is corrupted.

Could you please help me? My GMT script is below.

rem xyz2grd depths.txt -Gtest.grd -R24/38/21.5/33.5 -I1m -V

surface depths.txt -Gtest.grd -R24/38/21.5/33.5 -I1m -V

grd2cpt test.grd -Crainbow -L0.0/175.2 -S0.01/1.3/0.01 -Qi -D0.0/175.2 > rgb

rem nearneighbor depths.txt -Gtest.grd -R24/38/21.5/33.5 -I1m -V -S100k

pscoast -Jm0.4i -R24/38/21.5/33.5 -Ba5f0.g0./a5f0.g0.WSen -Lf26.5/22.7/20/200 -Df -A1 -W1p -Ir/1p,turquoise1 -P -V -Swhite -K >>

psscale -Dx8c/1c+w12c/0.5c+jTC+h -Jm -R -Q -O -Crgb -Bx5+lDepth -By+lkm >>

psxy motion.txt -Jm -R -Sc -Crgb -V -O -K >>

psxy station.txt -Jm -R -S -V -Wthin,red -O >>

psconvert -Tg -P -A

Please format your post by wrapping the code with triple backticks ```

The problem is that “middle commands writing to the postscript file” need both -K and -O I think, your psscale command uses only the -O

1 Like

This is the curse classic mode users of GMT will struggle with - not so in modern mode.

Thank you so much. It is really a very big help. I am deeply appreciating your time.

I am so sorry for any disturbance. I am not a professional in GMT. I am really struggling to get my job done.
the problem is solved finally. Thank you so much.

No worries. Just giving hints that modern mode would be much simpler for you, with less traps like the one you fell in.

1 Like