-C question

Hello everyone,recently I use -Cdr_plot.cpt that has been running without results and can run the results without using the dr_plot.cpt

dr_plot.txt (343 Bytes)

I am not sure. But I have just check dr_plot.txt file and I think that the CPT needs only integer values. If I were you, I would try that.

-30	48/18/59	-20	70/106.75/226.63
-20	70/106.75/226.63	-10	40.5/187.25/235.75
-10	40.5/187.25/235.75	0	48.875/241.62/153.13
0	48.875/241.62/153.13	10	162.5/252.5/60.5
10	162.5/252.5/60.5	20	236.75/208.25/58
20	236.75/208.25/58	30	251/128.25/33.75
30	251/128.25/33.75	40	209.75/48.75/5
40	209.75/48.75/5	50	122/4/3
B	48/18/59
F	122/4/3
N	127.5

When you say “without any results” do you mean that the atm_a.png file is not created and there are no messages/errors in the process?

Thank you for your reply,I’ll try

Yeah, when running the script with -Cdr_plot.cpt, that has no response, and no image is generated just like the first picture on question top.

I run the modified script and this happened

In modern mode, if you really need to access the CPT file by name then you need to add -H. But most of the time you would just say

gmt makecpt -Cturbo -T-30/50/10 -Z -D
gmt grdimage vel2_atm.grd -JX6i+ -Q -B
gmt colorbar-rect-default -Bxaf+l"...."
gmt end

The makecpt command sets the “current CPT” and then grdimage and colorbar will use it by default.

Thank you so much,it can work!

I also came across the described problem. After the conversion, now I found the description of the ‘-H’ option on the module page of grdimage, but only as a comment for modern mode at the end of the page. I recommend to add the ‘-H’ flag option, and to give a hint at the -C option.

sorry conversation of course :slight_smile:

Well, we cannot add a -H option to on the grdimage man page; the -H is an option of makecpt and grd2cpt. I will see if we can add a hint-link near -C that takes you down to the discussion of current CPTs. Our main concerns have been to allow users of classic mode to work as they always have, but once you are writing modern mode scripts then you must follow how things are done in modern mode regarding CPTs etc.

Thanks, I got it. The -H option in makecpt I was not aware of.