Moving Plot Frame (PYGMT Relief)

Hi,

I am trying to plot a relief map and change the area viewed by getting a different ROI for cities around the world based on their x-y locations and a measure of spread in x and y. The code I am using to plot is:

def plot_map(grid, area):
    """Plot the grid map out with a mercanter projection."""
    fig = pygmt.Figure()
    fig.grdimage(grid=grid, projection="M20c", frame="a", cmap="geo")
    fig.show()

The issue is that when using frame=“a”, if I move to a new location the frame stays in the same place as my original map. The original plot I get is:

But if I move the grid region up I get the following:

Is there a way to manually define the grid frame so that I can show the area I am getting the grid of?

I tried:

where the area is the [xmin,xmax,ymin,ymax] list used to define the pygmt.datasets.load_earth_relief() region of interest but I get the following error:

Interestingly this error goes away if I used positive y values but it still does not show the map of interest.

Best,
Graham

The region parameter to grdimage can set the plot region:

def plot_map(grid, area):
    """Plot the grid map out with a mercator projection."""
    fig = pygmt.Figure()
    fig.grdimage(grid=grid, projection="M20c", frame="a", region=area, cmap="geo")
    fig.show()