GMT grdimage output smaller

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!

#!/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 (634 Bytes)

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

Hi Joaquim,

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

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.

Hi Joaquim,

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

log1.txt (5.8 KB)

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

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.

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!!!