datafile=../data.nc
region=-R172/186/-40/-25
echo $region
project=-JM180/0/6i
border=-Bf1a5nSWe
gmt begin plot1 png -Vl
gmt makecpt -Cjet -D -M -T-1000/1000/1 > tmp.cpt
gmt grdimage $datafile?max_height $region $project $border -Ctmp.cpt -Q
gmt coast $region $project $border -W -Df -Ggrey -N1/1p,white
gmt end
and it gives me the same behaviour as above, i,e, i get plots if i d each line individually, but i can’t get one to plot on top of the other in the same file.
Windows binaries running modern mode in Cygwin is new territory.
Modern mode creates ~/.gmt/sessions temporary directories but does that taking into account the OS. But, cygwing tries to ignore that it’s running on Windows and probably the Win build binaries fail in something. The best is to use a MinGW derived bash. Like the one that comes with Github for windows.
It is definitively a “cygwin thing”. You could try adding -Vd to the commands and post the result and maybe there is a clue in there, but don’t expect us to be able to spend much time debugging on that sort of platform. I did some testing on Cygwin 6-10 years ago but with better solutions (Ubunto bash for Windows, MingGW) there is no point anymore.
BTW, for your modern script you need to remove the redirection to tmp.ctp and remote the -Ctmp.cpt from grdimage.
@Joaquim @pwessel @seisman
Ok, thanks for info. I thought it might be something deep, which is unfortunate…
Will try the trick that @seisman suggested. I was reading that section last night, but was not sure if/how it applied to my situation.
I haven’t had a chance to fully investigate the Ubuntu/bash thing on windows. The few things i tried, didn’t really work properly, but i didn’t put much effort in to it…
and yes, @pwessel, noted about the > *.cpt, I had other version where I had removed it etc…
But I thought it was optional and that you could leave it in there and it would still work in modern? Like if you want to make sure the right cpt gets called in the right place and not rely on the automated thing. At least that is how I understood it from reading the docs.
As always, thanks so much for your efforts and helpful replies!
-jose