GMT_COMPATIBILITY error

Hi all, I am running the following script:

gmt begin map
gmt grdimage grid.grd -Ccolor.cpt -Ishade.grd -JU20/6i -BWSen -B2mf1mg2m -R-64.34/-64.19/44.43/44.56 -V
gmt coast -Df -Gtan -Wthinnest
gmt end show

and I receive this error:

gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6

Also, the pagesize of the resulting pdf is insanely huge - 16.9cm by 1123.1 cm, even though the PS_MEDIA is set to a4 in gmt.conf.

The gmt.conf is in the current directory the script is being run from; if I delete gmt.conf, the error message goes away, and the pdf page size results in the desired a4. I do not have a gmt.conf in my home folder, or anywhere in ~/.gmt.

Does anyone know what the error refers to? Additionally, is there any other location where a rogue version 5 gmt.conf might be interfering?

Thanks,

~ Eric.

gmt [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6

This should be a warning, not an error. The issue was reported in issue #1980 and then fixed in #1981.

Currently you have a few options:

  1. Just ignore these errors, which don’t affect your figures
  2. Cleanup any pre-existing older gmt.conf files and these errors will disappear
  3. Install the GMT development version

As for the gmt.conf file, I believe GMT tries to search for it in following order:
Current directory -> ${HOME} -> ${HOME}/.gmt. You may add -Vd to gmt begin and check which gmt.conf is used.

Thanks for the reply. I ran ‘find ./ -name gmt.conf’ from my home folder, and the only gmt.conf in existence is the one being used for the current figure. Even if I pass --PS_MEDIA=a4 with grdimage, I still get an a0 page height.

Running gmt begin -Vd gives me:

‘gmt [DEBUG]: Found file gmt.conf’ so presumably, the same gmt.conf in the directory I’m running the command from, so that doesn’t shed any light.

I am not sure what is going on with your example. I don’t have the grid so I just changed it to do the coastline and it gives the expected plot. You are asking for a PDF and it will by default be cropped to what is needed. The PS_MEDIA setting should only be used if you are in need of a particular PostScript plot. For all other media we simply return the cropped illustration regardless of size (up to ~11x1 meters). Any further padding is controlled by the PS_CONVERT defaults setting or as an optional argument to gmt begin.
However, giving PS_MEDIA does seem to affect the plot (negatively) so perhaps we are processing that even if we should not.

Paul,

I’ve made a rather strange discovery; if I run

gmt begin -Vl (or -Vd)
then
gmt begin testmap
gmt coast -Df -Gtan -Wthinnest -BWSen -B2mf1mg2m -R-64.34/-64.19/44.43/44.56 -JU20/6i
gmt end show

The pdf plot looks fine. (I excluded the grdimage command to eliminate the possibility of my raster being the cause).

If instead I only run ‘gmt begin testmap’ without the initial ‘gmt begin -Vl’ first, and keep the rest of the script identical, the plot size becomes 16.5 × 1123 cm (instead of a4 which is in gmt.conf).

I read in a previous GMT forum post that some versions of Ghostscript are bug-ridden, so if it helps I’m using version 9.26.

The bug that causes PS_MEDIA to affect non-PostScript plots is addressed by a pull request - hopefully merged in by tomorrow in the 6.0 branch.

Is it possible that maybe I didn’t uninstall version GMT 5.4.5 properly prior to installing version 6, and this could be causing conflicts somehow? Did a gmt_uninstall.sh script exist for version 5?