Figure placement on page when using PS_SCALE_X/Y

I’m trying to make a plot scaling the plot size using PS_SCALE_X and PS_SCALE_Y. It anchors the figure to the bottom left side of the page. Is there a way to specify where on the page to place the figure? I was looking through the gmt.conf documentation but I couldn’t find anything.

Here’s an example of the issue:

import pygmt

pygmt.config(PS_MEDIA = "letter")
pygmt.config(PS_SCALE_X = 0.8)
pygmt.config(PS_SCALE_Y = 0.8)

region = [0, 1, 0, 1]

fig = pygmt.Figure()
fig.basemap(region=region, projection="X15c", frame=True)
fig.savefig('test.png', crop=False)

Hi @atrevisan21, maybe try using fig.shift_origin()? Try something like

fig = pygmt.Figure()
fig.shift_origin(xshift="0.2c", yshift="0.3c")

Thanks that works. I also found MAP_ORIGIN_X and MAP_ORIGIN_Y in gmt.conf to configure these parameters.

1 Like