Gmt begin/psconvert and borders around images

Hi,

I’m sure I’m doing something trivially wrong. I want to have 0.5 cm wide blank borders around the plots that GMT creates. In the past I used to be able to do this, but now it’s no longer working for some reason - no doubt I’ve changed something. My plots are cropped right up to annotations/frames etc, which is not what I want.

Here’s example code:

#!/usr/bin/env bash

gmt begin testplot PNG A,I+m0.5c -C
        gmt set GMT_THEME modern
        gmt set PROJ_LENGTH_UNIT c
        gmt coast -JM15c -R165/-30/205/-5+r -BWseN -Dh -Wthinnest,black -Bpxa10g10 -Bpya10g10
gmt end

And here’s the output:

I’m afraid that’s a modern mode bug. Your example works fine if you convert it to classic mode.

1 Like

Isn’t there a workaround with subplot (-M).?

the easiest IMO workaround is to generate .ps and call ps2raster manually. I presume the TS knows that.

#!/usr/bin/env bash

gmt begin testplot ps
        gmt set GMT_THEME modern
        gmt set PROJ_LENGTH_UNIT c
        gmt coast -JM15c -R165/-30/205/-5+r -BWseN -Dh -Wthinnest,black -Bpxa10g10 -Bpya10g10
gmt end

gmt ps2raster -TG -A -I+m0.5c testplot.ps