# Gmt begin/psconvert and borders around images

**URL:** <https://forum.generic-mapping-tools.org/t/gmt-begin-psconvert-and-borders-around-images/5863>\
**Category:** Q&A\
**Created:** [April 27, 2025, 8:51pm UTC](https://forum.generic-mapping-tools.org/t/gmt-begin-psconvert-and-borders-around-images/5863 "2025-04-27T20:51:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timhume](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/timhume/32/296_2.png) [@timhume](https://forum.generic-mapping-tools.org/u/timhume)\
**Post date:** [April 27, 2025, 8:51pm UTC](https://forum.generic-mapping-tools.org/t/gmt-begin-psconvert-and-borders-around-images/5863/1 "2025-04-27T20:51:50Z")

</div>

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:

```auto
#!/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:

 ![testplot](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7033c7c82c6d8c77cbe2ae5689e845c294648762.png)

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [April 27, 2025, 9:51pm UTC](https://forum.generic-mapping-tools.org/t/gmt-begin-psconvert-and-borders-around-images/5863/2 "2025-04-27T21:51:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [April 28, 2025, 7:37am UTC](https://forum.generic-mapping-tools.org/t/gmt-begin-psconvert-and-borders-around-images/5863/3 "2025-04-28T07:37:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [April 28, 2025, 11:05am UTC](https://forum.generic-mapping-tools.org/t/gmt-begin-psconvert-and-borders-around-images/5863/4 "2025-04-28T11:05:58Z")

</div>

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

```auto
#!/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

```
