Makecpt for sea and land. Command problem

Hello, I have a question about GMT5 running in windows. Well I would like to put sea and land in my map. The problem is that sea and map has the same colour. I am using commands makecpt , grdimage.
my code in GMT is:

makecpt -Cglobe -T-5000/5000/100 -V > bot.cpt
makecpt -Cgray -T-2000/2000/20 -V > land.cpt


pscoast -JM17 -R22.5/23.5/37.7/38.3 -B1f1 -Ggray90 -Snavyblue -Df -N1/2.8p,- -W1.5p,black -X1.5 -V -Lf21.0/34/36.5/200 -P -K >

grdimage C:/Users/HP/Desktop/GMT\aeg_sea.grd -n+c -Cbot.cpt -R22.5/23.5/37.7/38.3 -JM17 -IC:/Users/HP/Desktop/GMT\int_sea.grd -Ba0.1f0.01::WeSn -V -K -P -Xc -Yc >

grdimage C:/Users/HP/Desktop/GMT/1\hellas_land.grd -n+c -Cland.cpt -R -JM -IC:/Users/HP/Desktop/GMT\int_h.grd -B -V -O -K >>

I want to say that I can not find the command that separates sea color of land color.

Could anyone help me?
Thank you in advance

Updating to GMT6 will get you the most help.

Happy home Easter

I am afraid that I am not able to do this, because it is stable to the computer of my work

the problem is that I can not find command in order to convert the color of the sea from green to blue. I have to do some changes in makecpt command? ALso, I have to mention that bot.cpt is used for the sea

I don’t have GMT5 anymore and don’t remember f there is one cpt made up with a sharp transition at 0, but you can manually create a cpt file to made up with 2 distinct cpts. One for the negative part and the other for positives. GMT6 had hinged cpts to do exactly this.

Ι observed that GMT4 has many differences with GMT5. GMT6 has too many differences too? In scripting i mean

None and a few.

  • None if you keep using the classical mode. By none I mean GMT4 & 5 syntax still works but area off course the endless number of new features added in GMT6
  • A few in modern mode

Manual explains what is new in modern mode.

I think you need to write them to the same cpt file

something like:
makecpt -Cglobe -T-5000/0/100 -V > new_cpt.cpt
makecpt -Cgray -T0/2000/20 -V >> new_cpt.cpt

This will then make one cpt file using ‘globe’ for the values from -5000 to 0 (water i assume) and ‘gray’ from 0 to 2000 (land).

note the use of the ‘>>’ in the second line so that it appends to the file

Sorry I don’t have a sample of the code here on this computer to double check the syntax, but it’s something like that!


sorry, i didn’t read your message carefully… my solution works if your land and sea data are all in the same .grd file.

the way you are doing it, you might need to paint transparent NANs over the sea area in your land file. you can do that with grdmath, NAN command (i think), then use the -Q in grdimage to make the NANs transparent

also, i think you need the ‘>>’ starting on the 2nd line that writes to