# Plot is getting cutoff

**URL:** <https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976>\
**Category:** PyGMT Q&A\
**Created:** [May 30, 2025, 4:58pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976 "2025-05-30T16:58:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wthelen](https://avatars.discourse-cdn.com/v4/letter/w/46a35a/32.png) [@wthelen](https://forum.generic-mapping-tools.org/u/wthelen)\
**Post date:** [May 30, 2025, 4:58pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/1 "2025-05-30T16:58:13Z")

</div>

Not a PyGMT problem per se, but after an update to the newest versions of pygmt and gmt (and probably ghostscript), my plots are now being cutoff. I have tried setting PS\_MEDIA with no change, I’ve also tried changing the PS\_PAGE\_ORIENTATION with no change. When I pull the resulting file into illustrator, there is nothing being plotted outside of what is shown in preview. Should I fallback to a previous version or is there a command or flag that I’m missing?

 ![test](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/9/91960120dd958cbffb65a25e4b17c9e32e4ef409.png)

Here is a code snippet to recreate the problem:

```auto
import pygmt
region = [-155.72,-155.62,19.45,19.55]
proj = 'M8i'
fig = pygmt.Figure()
fig.coast(region=region, projection=proj, land='gray', water='skyblue', frame=True)
fig.show()

```

Here is the output of pygmt.show\_versions()

```auto
PyGMT information:
  version: v0.15.0
System information:
  python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:35:20) [Clang 16.0.6]
  executable: /opt/miniconda3/envs/pygmt/bin/python
  machine: macOS-14.7.5-arm64-arm-64bit
Dependency information:
  numpy: 1.26.4
  pandas: 2.2.3
  xarray: 2024.10.0
  netCDF4: 1.6.5
  packaging: 24.1
  contextily: None
  geopandas: 1.0.1
  IPython: 8.29.0
  pyarrow: None
  rioxarray: None
  gdal: 3.9.1
  ghostscript: 10.04.0
GMT library information:
  version: 6.5.0
  padding: 2
  share dir: /opt/miniconda3/envs/pygmt/share/gmt
  plugin dir: /opt/miniconda3/envs/pygmt/lib/gmt/plugins
  library path: /opt/miniconda3/envs/pygmt/lib/libgmt.dylib
  cores: 16
  grid layout: rows
  image layout: 
  binary version: 6.5.0

```

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [May 30, 2025, 6:09pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/2 "2025-05-30T18:09:41Z")

</div>

Thanks @wthelen for this report.

Hm, I am wondering if this problem is the same as the one reported in [Why the subplot second panel is getting cut? - #5 by geodacharya](http://forum.generic-mapping-tools.org/t/why-the-subplot-second-panel-is-getting-cut/5969/5).

If I run your code with a PyGMT dev version + GMT 6.5.0 and ghostscript 10.03.0. The map isn’t cut off. However, in both topics, higher gs versions are used. So, maybe there is a problem with higher gs versions. I have to make an environment with gs higher than 10.03.0 and test on my own.

---

<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:** [May 30, 2025, 6:58pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/3 "2025-05-30T18:58:14Z")

</div>

Maybe share the PS file. PyGMT uses only modern mode and in it the paper size is wall sized (11 meters) so it’s difficult to imagine how this happens and even more that it’s ghostscript issue (but something is).

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [May 30, 2025, 7:41pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/4 "2025-05-30T19:41:53Z")

</div>

So, I installed gs 10.04.0 and I do not face to problem of cut off maps in PyGMT.

---

<div class="post-metadata">

**Author:** ![wthelen](https://avatars.discourse-cdn.com/v4/letter/w/46a35a/32.png) [@wthelen](https://forum.generic-mapping-tools.org/u/wthelen)\
**Post date:** [May 31, 2025, 5:40am UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/5 "2025-05-31T05:40:49Z")

</div>

Thank you for your rapid response.

Downgraded to 10.04.0. There are some changes.

1. No change to what is displayed with fig.show() (figure still cutoff)
2. When saved as eps, the file is rotated 90 degrees with the whole figure frame rendered
3. When saved as pdf, it looks the same as fig.show() (figure still cutoff)

Attached .pdf. Can’t save as .ps in pygmt and I can’t upload the .eps.

[test.pdf](https://forum.generic-mapping-tools.org/uploads/short-url/6Yf8DxDMMYCbo6zHBOwz0oQvb5G.pdf) (5.5 KB)

Here is the new output of show\_versions for completeness:  
PyGMT information:  
version: v0.15.0  
System information:  
python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:35:20) [Clang 16.0.6]  
executable: /opt/miniconda3/envs/pygmt/bin/python  
machine: macOS-14.7.6-arm64-arm-64bit  
Dependency information:  
numpy: 1.26.4  
pandas: 2.2.3  
xarray: 2024.10.0  
netCDF4: 1.7.2  
packaging: 24.1  
contextily: None  
geopandas: 1.0.1  
IPython: 8.29.0  
pyarrow: None  
rioxarray: None  
gdal: 3.11.0  
ghostscript: 10.04.0  
GMT library information:  
version: 6.5.0  
padding: 2  
share dir: /opt/miniconda3/envs/pygmt/share/gmt  
plugin dir: /opt/miniconda3/envs/pygmt/lib/gmt/plugins  
library path: /opt/miniconda3/envs/pygmt/lib/libgmt.dylib  
cores: 16  
grid layout: rows  
image layout:  
binary version: 6.5.0

---

<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:** [June 1, 2025, 4:22pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/6 "2025-06-01T16:22:26Z")

</div>

The pdf is no good (too late). You can zip the `eps` and attached here. But what I would like is the `ps`. Sure is not possible? Others?

---

<div class="post-metadata">

**Author:** ![chhei](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei/32/32_2.png) [@chhei](https://forum.generic-mapping-tools.org/u/chhei)\
**Post date:** [June 1, 2025, 10:39pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/7 "2025-06-01T22:39:25Z")

</div>

I can report the exact same issues as @wthelen with a slightly different configuration (see below). Have played a bit with width/height ratios and it seems that in my case the maps with a N-S:E-W ratio of \>1.5 seem to be ok, although there the inset map is getting cut off (only if the map title is wider than map width + inset map, the map is not cut off in width). Maps with a height:width ratio \< 1.5 are all getting cut off at the top.

EPS and PDF attached, pygmt doesn’t want to write out `*.ps`:

```auto
File "/Users/christian/Library/Python/3.12/lib/python/site-packages/pygmt/figure.py", line 228, in savefig
    raise GMTInvalidInput(msg)
pygmt.exceptions.GMTInvalidInput: Extension '.ps' is not supported. Use '.eps' or '.pdf' instead.

```

Cheers,  
Christian

```auto
PyGMT information:
  version: v0.14.2
System information:
  python: 3.12.9 (main, Feb 8 2025, 10:24:47) [Clang 16.0.0 (clang-1600.0.26.6)]
  executable: /opt/local/bin/python3
  machine: macOS-15.3.2-arm64-arm-64bit
Dependency information:
  numpy: 1.26.4
  pandas: 2.2.3
  xarray: 2025.3.0
  netCDF4: 1.7.2
  packaging: 24.2
  contextily: None
  geopandas: 1.0.1
  IPython: 8.31.0
  pyarrow: None
  rioxarray: None
  gdal: 3.10.2
  ghostscript: 10.05.0
GMT library information:
  version: 6.6.0
  padding: 2
  share dir: /usr/local/gmt/share
  plugin dir: /usr/local/gmt/lib/gmt/plugins
  library path: /usr/local/gmt/lib/libgmt.dylib
  cores: 12
  grid layout: rows
  image layout:
  binary version: 6.6.0_e1f3593-dirty_2025.03.18

```

[50e7305c-6f31-4fa1-a945-beb501956b9e.eps.zip](https://forum.generic-mapping-tools.org/uploads/short-url/u7CjEp3XNjd4SPf9OX5JFvyYWo5.zip) (22.6 KB)  
[50e7305c-6f31-4fa1-a945-beb501956b9e.pdf](https://forum.generic-mapping-tools.org/uploads/short-url/mnHGwjBbwxnnO7fM8MgXLVflK5M.pdf) (29.6 KB)

---

<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:** [June 2, 2025, 12:18pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/8 "2025-06-02T12:18:14Z")

</div>

Unfortunately, I cannot figure out what happened. Namely, why the `eps` is in Landscape when the `ps` must have been created in Portrait.

---

<div class="post-metadata">

**Author:** ![chhei](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/chhei/32/32_2.png) [@chhei](https://forum.generic-mapping-tools.org/u/chhei)\
**Post date:** [June 2, 2025, 2:17pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/9 "2025-06-02T14:17:33Z")

</div>

@yvonnefroehlich & @Joaquim - here are a `*.ps` of @wthelen’s script translated to plain GMT. This one get chopped off at the right

```auto
#!/usr/bin/env zsh
gmt begin
gmt figure test ps,pdf,png
# region = [-155.72,-155.62,19.45,19.55]
gmt coast -R-155.72/-155.62/19.45/19.55 -JM8i -Ggray -Bafg
gmt end

```

[test.ps](https://forum.generic-mapping-tools.org/uploads/short-url/mTelLiY3zwVLpJHqLIe7sOCov1a.ps) (25.5 KB)

and another one which gets cut off at the top:

```auto
#!/usr/bin/env zsh
gmt begin
gmt figure test2 ps,pdf,png
gmt basemap -R87/89/27/31 -JD88.0/29.0/31.0/27.0/15c -Bafg
gmt end

```

[test2.ps](https://forum.generic-mapping-tools.org/uploads/short-url/fUwoFbBeDHe6q33JCXC2Cv5QBNi.ps) (26.4 KB)

---

<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:** [June 2, 2025, 3:14pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/10 "2025-06-02T15:14:56Z")

</div>

Hmmm, cannot confirm that. This one-liner (same as your first example) works fine for me.

```auto
gmt coast -R-155.72/-155.62/19.45/19.55 -JM8i -Ggray -Bafg -png lixo

```

---

<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:** [June 2, 2025, 3:36pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/11 "2025-06-02T15:36:06Z")

</div>

On my system `-ps lixo` gets cut while `-png lixo` does not. PyGMT example does not get cut either.

---

<div class="post-metadata">

**Author:** ![wthelen](https://avatars.discourse-cdn.com/v4/letter/w/46a35a/32.png) [@wthelen](https://forum.generic-mapping-tools.org/u/wthelen)\
**Post date:** [June 2, 2025, 3:46pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/12 "2025-06-02T15:46:20Z")

</div>

I downgraded versions of ghostscript from 10.04 to 10.03,10.02 and 9.56 (No other libraries changed). All had the same behavior (cut off the map).

Returning to gs 10.04, I can recreate the behavior of @Joaquim and @mkononets. I will note that the “-ps lixo” result cuts the plot on the right. It also retains the portrait orientation (unlike the .eps output from .savefig.

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [June 2, 2025, 4:20pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/13 "2025-06-02T16:20:26Z")

</div>

Now I tried different things. Overall, I think the issue is related to the “ps” format, and for me, the maps are cutoff also for gs versions lower than 10.4.0.

This works fine for me:

```bash
gmt begin
gmt figure test_no_ps pdf,png
gmt basemap -R-155.72/-155.62/19.45/19.55 -JM8i -Bafg
gmt end

```

but adding “ps”, leads to cutoff maps for all formats:

```bash
gmt begin
gmt figure test_with_ps ps,pdf,png
gmt basemap -R-155.72/-155.62/19.45/19.55 -JM8i -Bafg
gmt end

```

I face the same behaviour here, wherey png (or pdf) work:

```bash
gmt basemap -R-155.72/-155.62/19.45/19.55 -JM8i -Bafg -png lixo

```

but ps (or eps) leads to cutoff maps:

```bash
gmt basemap -R-155.72/-155.62/19.45/19.55 -JM8i -Bafg -ps lixo

```

---

<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:** [June 2, 2025, 4:27pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/14 "2025-06-02T16:27:28Z")

</div>

> [@yvonnefroehlich](#):
>
> adding “ps”, leads to cutoff maps for all formats

same here.

---

<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:** [June 2, 2025, 7:04pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/15 "2025-06-02T19:04:17Z")

</div>

OK, so this is what is happening.  
In modern mode (PyGMT) only the non-(e)ps formats are plotted in a wall size paper (11 m), which is latter trimmed to the figures BoundingBox. With the (e)ps format, the figure is plotted on a A4 (default) paper size and if the figure overflows it, it get cropped.  
Things are more clear on classic mode where we get a warning.

```auto
gmt psbasemap -R-155.72/-155.62/19.45/19.55 -JM8i -Bafg -P > lixo.ps
psbasemap [WARNING]: Your plot (WxH = 20.32 x 21.43 cm) placed at (2.54, 2.54 cm) may exceed your PS_MEDIA (WxH = 20.99 x 29.70 cm)

```

---

<div class="post-metadata">

**Author:** ![wthelen](https://avatars.discourse-cdn.com/v4/letter/w/46a35a/32.png) [@wthelen](https://forum.generic-mapping-tools.org/u/wthelen)\
**Post date:** [June 2, 2025, 8:56pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/16 "2025-06-02T20:56:27Z")

</div>

Thanks for tracking that down!

Now I’m trying to figure out how best to solve this issue. Setting the PS\_MEDIA doesn’t change the behavior (tried a fixed size, like “B1” and a custom size). Is there a parameter that needs to be passed through the PS\_CONVERT config to keep from trimming the BoundingBox? I’ve tried a few different iterations using the I flag (I+m3i, I+sm10i, I+s10i). The results are so similar that I’m not sure its actually doing anything at all.

---

<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:** [June 2, 2025, 9:08pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/17 "2025-06-02T21:08:37Z")

</div>

Not sure this observation is relevant, but both users reporting the issue on PyGMT use `macOS-...-arm64-arm-64bit`. My Linux x86\_64 system does not experience the PyGMT issue.

---

<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:** [June 2, 2025, 10:20pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/18 "2025-06-02T22:20:36Z")

</div>

I have to confess that this issue got over my PostScript knowledge. I did an experiment in Julia where I do always set the wall paper size and asked an `eps` output … which is also cut. _e.g._

```auto
basemap(R="-155.72/-155.62/19.45/19.55", J="M8i", B="afg", show=1, fmt=:eps)

```

Now the bloody crazy thing. Even if I delete the “BoundingBox” and “HiResBoundingBox” lines from the `.eps` file (attached) it still bloody knows the paper size. How’s that possible?

[GMTjl\_j.zip](https://forum.generic-mapping-tools.org/uploads/short-url/8L2e7kCxi6lBot257os8Kq2TWs4.zip) (7.0 KB)

---

<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:** [June 2, 2025, 11:04pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/19 "2025-06-02T23:04:13Z")

</div>

> [@Joaquim](#):
>
> Even if I delete the “BoundingBox” and “HiResBoundingBox” lines from the `.eps` file (attached) it still bloody knows the paper size. How’s that possible?

I’m not an expert, but I think the `.[e]ps` viewer software always has some specific paper size pre-set. Like my `gv` sets `A4` by default and `GMTjl_j.eps` gets cut. If I change paper size to A3 the `GMTjl_j.eps` gets enough paper to be fully displayed. Another viewer (`xreader`) sets `US Letter` paper size by default and does not let me to specify paper size manually.

if I run `gmt ps2raster GMTjl_j.eps -A -Tg` I get a correctly displayed and cropped png image.

---

<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:** [June 2, 2025, 11:19pm UTC](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976/20 "2025-06-02T23:19:11Z")

</div>

It’s a bit more convoluted than that. If you take the original `ps` (attached) and do:

```auto
gmt psconvert GMTjl_j.ps -Te -A

```

you get a nice **cropped** `eps`. But if we do

```auto
gmt psconvert GMTjl_j.ps -Tg -A

```

than we get a nice **full** png image. Now the puzzling thing is that the good `png` was created from the **bad(?)** `eps` file (`psconvert` internals). How can that be?

Note, I loaded the `eps` file in Inkscape and even if I increase the page width, the right size remains cropped.

[GMTjl\_j.ps.zip](https://forum.generic-mapping-tools.org/uploads/short-url/xKSwIV1NYkAe2Kkako8HOzX5ufR.zip) (7.2 KB)

[Next page](https://forum.generic-mapping-tools.org/t/plot-is-getting-cutoff/5976.md?page=2)
