# Moving Plot Frame (PYGMT Relief)

**URL:** <https://forum.generic-mapping-tools.org/t/moving-plot-frame-pygmt-relief/2097>\
**Category:** PyGMT Q&A\
**Created:** [September 15, 2021, 5:34pm UTC](https://forum.generic-mapping-tools.org/t/moving-plot-frame-pygmt-relief/2097 "2021-09-15T17:34:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggreig](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@ggreig](https://forum.generic-mapping-tools.org/u/ggreig)\
**Post date:** [September 15, 2021, 5:34pm UTC](https://forum.generic-mapping-tools.org/t/moving-plot-frame-pygmt-relief/2097/1 "2021-09-15T17:34:12Z")

</div>

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:

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

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

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/b4903dd6151e1e9d808ff0ddcc7732b94e448b2b.jpeg)

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:

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/1/17cd3875dc60bf4b479d94fb6e17bd1baf3940e8.png)

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:

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/3/368666b5bac5c1025f9aa5cfc6e186fd10724947.png)

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

Best,  
Graham

---

<div class="post-metadata">

**Author:** ![maxrjones](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/maxrjones/32/2698_2.png) [@maxrjones](https://forum.generic-mapping-tools.org/u/maxrjones)\
**Post date:** [September 16, 2021, 4:03pm UTC](https://forum.generic-mapping-tools.org/t/moving-plot-frame-pygmt-relief/2097/2 "2021-09-16T16:03:03Z")

</div>

The region parameter to grdimage can set the plot region:

```auto
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()

```
