# GMT grdimage output smaller

**URL:** <https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160>\
**Category:** Q&A\
**Created:** [January 2, 2021, 1:14am UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160 "2021-01-02T01:14:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caleb](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Caleb](https://forum.generic-mapping-tools.org/u/Caleb)\
**Post date:** [January 2, 2021, 1:14am UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/1 "2021-01-02T01:14:29Z")

</div>

Hi all,

When I run gmt grdimage, sometimes, the plot looks ok (image is centered). At other times, the plot covers a small portion of the page usually the bottom-center.

I was wondering if there might be something in my code that’s causing this?

Is there way to specify the position (and size) of the plot on the page?

Thank you!

Happy New Year!

```auto
#!/bin/bash
cd SBAS
#gmt makecpt -Celevation -T-100/400/10 -Z -D > new.cpt
#gmt makecpt -Cterra -T200/500/10 -Z -D > new.cpt
gmt makecpt -Cpolar -T-10/10/1 -Z -D > new.cpt

# Variables

format="jpg"
file="vel_ll_nan2.grd"

output="velocity3"

gmt begin $output $format
	gmt set FONT_ANNOT 10p,Times-Roman
	gmt set FONT_LABEL 10p,Times-Roman
	gmt grdimage $file -JM15c -I+d -B -BWSne -Cnew.cpt
	gmt coast -B -W1p,black #-Scornflowerblue #-Gbrown
	#gmt colorbar -DjTL+w5c+o.7c/1c+h+ml+e -Bxaf+l"LOS Displacement" -By+l"(rad)" #-Cnew.cpt 
	gmt colorbar -DJTC+w5c+o.7c/1c+h+ml -Bxaf+l"Mean velocity (mm/yr)" -By -Cnew.cpt 
gmt end show

```

[plot\_LOS.txt](https://forum.generic-mapping-tools.org/uploads/short-url/pHxGNbI3YhO3gaXmYl63flAnsTX.txt) (634 Bytes)

 ![velocity3](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/fb7a1c948852b131e3b17c5cfae408a16d139fd5.jpeg)

---

<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:** [January 2, 2021, 4:15pm UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/2 "2021-01-02T16:15:22Z")

</div>

I don’t see any obvious error in your script. What GMT & ghostscript versions?

---

<div class="post-metadata">

**Author:** ![Caleb](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Caleb](https://forum.generic-mapping-tools.org/u/Caleb)\
**Post date:** [January 2, 2021, 4:55pm UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/3 "2021-01-02T16:55:22Z")

</div>

Hi Joaquim,

I have GMT v6.1.0 and I just installed ghostscript v9.26 but same problem

---

<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:** [January 2, 2021, 5:05pm UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/4 "2021-01-02T17:05:38Z")

</div>

> [@Caleb](#):
>
> Is there way to specify the position (and size) of the plot on the page?

Sure there is, the **-X** & **-Y** plus the figure size allow all sorts of control. But that is classic mode. In modern one do not need it. Also, you don’t need the **-B** in `gmt coast -B ...` but it shouldn’t do any harm either. GS v9.26 has troubles in transparency. Better to update to latest version.

Try adding **-Vd** to the `gmt end show` line (I think it’s allowed) and post the output of it.

---

<div class="post-metadata">

**Author:** ![Caleb](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Caleb](https://forum.generic-mapping-tools.org/u/Caleb)\
**Post date:** [January 2, 2021, 5:38pm UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/5 "2021-01-02T17:38:14Z")

</div>

Hi Joaquim,

I did this “gmt end show -Vd” and it returned errors but still outputted the image, although with the same problem.

 ![velocity3](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/3a866f8d4431c38cbb22d754bfd69861a0fa373d.jpeg) [log1.txt](https://forum.generic-mapping-tools.org/uploads/short-url/avZVNIT4J1R2QVIZZkWKa8i8reF.txt) (5.8 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:** [January 2, 2021, 6:43pm UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/6 "2021-01-02T18:43:51Z")

</div>

I find this line quite suspicious. It seems to lack a **-A**

```auto
psconvert: '/home/kelly/.gmt/sessions/gmt_session.1978/gmt_0.ps-' -Tj -Fvelocity3

```

I’m afraid we’ll need a way to reproduce this behavior.

---

<div class="post-metadata">

**Author:** ![Caleb](https://avatars.discourse-cdn.com/v4/letter/c/58956e/32.png) [@Caleb](https://forum.generic-mapping-tools.org/u/Caleb)\
**Post date:** [January 3, 2021, 12:24pm UTC](https://forum.generic-mapping-tools.org/t/gmt-grdimage-output-smaller/1160/7 "2021-01-03T12:24:28Z")

</div>

Hi Joaquim,

Thanks a million. I noticed that moving the script and data to a different directory produces a “good” image. I think I’ll keep moving it around for the time being.

Thanks once again!!!
