# Gmt text cuts off

**URL:** <https://forum.generic-mapping-tools.org/t/gmt-text-cuts-off/4441>\
**Category:** Q&A\
**Created:** [November 16, 2023, 3:01pm UTC](https://forum.generic-mapping-tools.org/t/gmt-text-cuts-off/4441 "2023-11-16T15:01:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pa345](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@pa345](https://forum.generic-mapping-tools.org/u/pa345)\
**Post date:** [November 16, 2023, 3:01pm UTC](https://forum.generic-mapping-tools.org/t/gmt-text-cuts-off/4441/1 "2023-11-16T15:01:44Z")

</div>

I am combining multiple map views onto a single canvas, but it seems that gmt text will cut off text if it goes outside the current plotting map. Here is my example script,

```
#!/usr/bin/env bash

EQMERIDIAN="0"

# user configurable variables
nrow="2" # number of rows
ncol="3" # number of columns
eqwidth="1.26" # width of equatorial plot in inches
polwidth="0.54" # width of polar plots in inches
dx="0.05" # horizontal buffer in inches
dy="0.1" # vertical buffer in inches
bottom="1" # bottom buffer

# non-user configurable variables

# distance from left edge of north pole plot to left edge of equatorial plot
delta_ne=$(echo "scale=1; ${polwidth}/2" | bc)

# distance between right edge of north pole plot and left edge of south pole plot
delta_pp=$(echo "scale=1; ${eqwidth} + 2*(${delta_ne} - ${polwidth})" | bc)

# width of a single panel (equatorial,north,south plots)
panel_width=$(echo "scale=1; 2*${polwidth} + ${delta_pp}" | bc)

# XXX height of a single panel (equatorial,north,south plots)
panel_height="5"

# y offset between equatorial and polar plots in inches
yoffset="0.47"

pos_str=""

function eqpos {
  row="$1"
  col="$2"

  xpanel=$(echo "scale=1; (${panel_width} + ${dx}) * (${col} - 1)" | bc)
  xpos=$(echo "scale=1; ${xpanel} + ${delta_ne}" | bc)

  ypanel=$(echo "scale=1; (${panel_height} + ${dy}) * (${row} - 1)" | bc)
  ypos=$(echo "scale=1; ${ypanel} + ${yoffset} + ${bottom}" | bc)

  pos_str="-Xa${xpos}i -Ya${ypos}i"
}

function nppos {
  row="$1"
  col="$2"

  xpanel=$(echo "scale=1; (${panel_width} + ${dx}) * (${col} - 1)" | bc)
  xpos="${xpanel}"

  ypanel=$(echo "scale=1; (${panel_height} + ${dy}) * (${row} - 1)" | bc)
  ypos=$(echo "scale=1; ${ypanel} + ${bottom}" | bc)

  pos_str="-Xa${xpos}i -Ya${ypos}i"
}

function sppos {
  row="$1"
  col="$2"

  xpanel=$(echo "scale=1; (${panel_width} + ${dx}) * (${col} - 1)" | bc)
  xpos=$(echo "scale=1; ${xpanel} + ${polwidth} + ${delta_pp}" | bc)

  ypanel=$(echo "scale=1; (${panel_height} + ${dy}) * (${row} - 1)" | bc)
  ypos=$(echo "scale=1; ${ypanel} + ${bottom}" | bc)

  pos_str="-Xa${xpos}i -Ya${ypos}i"
}

gmt set MAP_FRAME_TYPE plain
gmt set MAP_TITLE_OFFSET "-0.1c"
gmt set MAP_FRAME_PEN "0.2p"

MIN_LAT="60"
eq_proj="-JW${EQMERIDIAN}/${eqwidth}i -Rg"
np_proj="-JG0/90/${polwidth}i -R-180/180/${MIN_LAT}/90"
sp_proj="-JG180/-90/${polwidth}i -R/-180/180/-90/-${MIN_LAT}"

gmt set FONT_TITLE "12p,Helvetica,black"
gmt set FONT_LABEL "10p,Helvetica,black"
gmt set FONT_ANNOT_PRIMARY "10p,Helvetica,black"

gmt begin figure png

  eqpos 1 1
  gmt basemap ${eq_proj} -B0 ${pos_str}
  echo "data" | gmt text ${eq_proj} ${pos_str} -F+f8p+cTL -D-0.1c/0

  nppos 1 1
  gmt basemap ${np_proj} -B0 ${pos_str}

  sppos 1 1
  gmt basemap ${sp_proj} -B0 ${pos_str}

gmt end show

```

and here is the result

 ![figure](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/6/6246d55aef670f9c9ed078e6d8e469775446a3e2.png)

The script has some machinery to compute the X/Y positions of each panel, but you can see there is plenty of room to print the full “data” string, but part of it gets cut off, I guess because it goes beyond the current Mollweide projection view. Is there a workaround for this?

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [November 16, 2023, 3:26pm UTC](https://forum.generic-mapping-tools.org/t/gmt-text-cuts-off/4441/2 "2023-11-16T15:26:40Z")

</div>

Nothing new here - see **text -N**.

---

<div class="post-metadata">

**Author:** ![pa345](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@pa345](https://forum.generic-mapping-tools.org/u/pa345)\
**Post date:** [November 16, 2023, 3:46pm UTC](https://forum.generic-mapping-tools.org/t/gmt-text-cuts-off/4441/3 "2023-11-16T15:46:22Z")

</div>

thank you
