How to run GMT6 in modern mode

To all GMT6 users

I am a long time GMT user living in Sapporo, Japan.
I use GMT to make rainfall distribution maps during floods.
I have a question about GMT6’s modern mode.
I am running GMT in a batch file on windows.
I am not using UNIX or Python.
I have installed gmt-6.2.0-win64.exe on my windows machine.
I can draw well in classic mode, but not at all in modern mode.
But in modern mode, I can’t draw at all.
Is there anything I can do to make it work in modern mode?
Any advice would be greatly appreciated.

From Yasuhiro Murakami

Hi @YasuLeo503, we’d be happy to help you learn modern mode. The main difference between modern and classic mode is that most functions were renamed to drop the leading ‘ps’. E.g. gmt pscoast becomes just gmt coast, and you don’t need to do the -O, -K redirection. You can compare between GMT6 and GMT5 at and

If you’d like, you can provide an example of a GMT classic mode script, and we can translate it to a GMT6 modern script to show you the difference.

Hi @Weiji14

Thanks for the reply.
As for the modern mode script.
Here is a script I found on a web site that draws the coastline of NewZealand.

gmt begin NewZealandMap png
gmt coast -JM12c -RNZ -Ba -W0.5p -A10000
gmt end show

Save this script as a windows batch file and run.
When I save this script as a windows batch file and run it, I do not get the resulting image that I should get.
I would like some advice on how to fix this.


What do you get?
This is what I get for your example turned into a one-liner (on Windows too)

gmt coast -JM12c -RNZ -Ba -W0.5p -A10000 -png NZ

Dear Dr. Joaqim
Thank you for your reply.
I tried the one-liner script on the command prompt and got an error. It is as shown in the attached image.
Could you please let me know if there is any special setting to make modern mode work on command prompt?


You have non-finished modern mode session. Probably the result of running NZ.bat
Run gmt clear sessions and repeat the one-liner.
The docs explain well how modern mode works.

Dear Professor joaqim
I tried to run gmt clear sessions as you told me, but it still didn’t work.
It seems that I am incompatible with modern mode, so for the time being I will use GMT in classic mode, which is safer and more secure.


Dear Professor joaquim

For your reference, I send you a script to draw the coastline of Hokkaido, where I live. This is in classic mode, with a postscript file generated.

gmt pscoast -Jm1.5 -R139/149/41.0/46.0 -Wthinner -Dh -P -V -S255 -K >> hok.eps


Hi Weiji14.
This is Murakami from Sapporo, who is struggling with Modern mode.
If it’s possible, could you please convert the following classic version commands to modern mode?

gmt pscoast -Jm1.5 -R139/149/41.0/46.0 -Wthinner -Dh -P -V -S255 -K >> hok.eps

And can you make sure that it works on the command prompt of your windows computer?

From Murakami in Sapporo

That command is part of an overlay (-K) so it cannot by itself be converted to modern mode. There would have to be a full script that makes a plot in classic mode. For more details on modern mode you can see the open access publication on GMT 6.

Don’t run NZ.bat after the gmt clear sessions because that’s the one who is very likely screwing.

Thank you all for your comments.
I have found it difficult to run modern mode on my computer environment.
Even the example modern mode script on GMT’s web site doesn’t work on windows command prompt. Why this is is too difficult for me to figure out.
From now on, I’ll use GMT in classic mode.

From YasuLeo503 in Sapporo, Japan