# Help with Creating Oblique Mercator

**URL:** <https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620>\
**Category:** PyGMT Q&A\
**Created:** [April 29, 2021, 2:37am UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620 "2021-04-29T02:37:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eemcmullan](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eemcmullan/32/1202_2.png) [@eemcmullan](https://forum.generic-mapping-tools.org/u/eemcmullan)\
**Post date:** [April 29, 2021, 2:37am UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/1 "2021-04-29T02:37:06Z")

</div>

Hello! I have been trying to create an oblique mercator with no success. Using the example from the “GMT” docs, could anyone verify I am translating this correctly? Thanks in advance!  
 ![Screen Shot 2021-04-28 at 10.20.10 PM](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c8c8e137409a82f54f49786dfeb75b9390d0e024.png)

![Screen Shot 2021-04-28 at 10.20.25 PM](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/3/3412c2cbb99f124054c336337aff093e42f73c67.png)

---

<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:** [April 29, 2021, 2:44am UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/2 "2021-04-29T02:44:04Z")

</div>

The screenshot of the code is difficult to read. Could you please cut and paste the PyGMT code to share? You can format it as code using three back-ticks before and after the block of code. For example:

```  
code  
```  
produces

```auto
code

```

---

<div class="post-metadata">

**Author:** ![eemcmullan](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eemcmullan/32/1202_2.png) [@eemcmullan](https://forum.generic-mapping-tools.org/u/eemcmullan)\
**Post date:** [April 29, 2021, 3:39am UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/3 "2021-04-29T03:39:03Z")

</div>

Of course; sorry about that!

```auto
fig = pygmt.Figure()
fig.coast(projection="Oc280/25.5/22/69/12c",
    region= [270, 305, 20, 25],
    frame="afg",
    land="gray",
    water="lightblue",
    )
fig.show()

```

The goal was to get an oblique view of the Caribbean, but am having little success.

---

<div class="post-metadata">

**Author:** ![weiji14](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/weiji14/32/33_2.png) [@weiji14](https://forum.generic-mapping-tools.org/u/weiji14)\
**Post date:** [April 29, 2021, 4:26am UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/4 "2021-04-29T04:26:50Z")

</div>

Hi @eemcmullan, could you also report the output or error you are getting? I can run your example fine, this is the figure I am getting with your code above:

 ![temp](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/e/e2f8a3d99f0d8ba00e83003ea918cdf3265feff0.png)

Maybe try posting the output of `pygmt.show_versions()`, in case there is something amiss with your installation, so that we can help debug.

---

<div class="post-metadata">

**Author:** ![eemcmullan](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eemcmullan/32/1202_2.png) [@eemcmullan](https://forum.generic-mapping-tools.org/u/eemcmullan)\
**Post date:** [April 29, 2021, 3:09pm UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/5 "2021-04-29T15:09:34Z")

</div>

I apologize, I don’t think my question was very good! I did get that output for my code. However, I am more-so wondering how this map from the GMT docs can be achieved with PyGMT, as using that region and projection doesn’t seem to work for me. Sorry again!

 ![Screen Shot 2021-04-29 at 11.05.58 AM](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/1/165f161ddb5769c6c997e68fd1fd8b3a907d3e42.png)

---

<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:** [April 29, 2021, 3:30pm UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/6 "2021-04-29T15:30:58Z")

</div>

Good question! Here is an example for that plot:

```auto
import pygmt

fig = pygmt.Figure()
fig.coast(projection="Oc280/25.5/22/69/12c",
    region="270/20/305/25+r",
    frame="afg",
    land="gray",
    water="lightblue",
    )
fig.show()

```

Specifically, you need to use a string for the region parameter so that you can append `+r` to denote that the coordinates are for the bottom-left and top-right corners.

We can improve the API docs about the region parameter; right now the best resource for an explanation about this is the ‘setting the region’ tutorial: [https://www.pygmt.org/dev/tutorials/regions.html](https://www.pygmt.org/dev/tutorials/regions.html).

---

<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:** [April 29, 2021, 3:52pm UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/7 "2021-04-29T15:52:01Z")

</div>

This is one of the cases where the wrappers could detect the situation and do the appropriate **-R…+r** call under the hood.  
(took a mental note to implement this in Julia)

---

<div class="post-metadata">

**Author:** ![eemcmullan](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/eemcmullan/32/1202_2.png) [@eemcmullan](https://forum.generic-mapping-tools.org/u/eemcmullan)\
**Post date:** [April 29, 2021, 4:25pm UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/8 "2021-04-29T16:25:42Z")

</div>

I gotcha, thanks so much for the help!

---

<div class="post-metadata">

**Author:** ![willschlitzer](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@willschlitzer](https://forum.generic-mapping-tools.org/u/willschlitzer)\
**Post date:** [May 1, 2021, 6:01am UTC](https://forum.generic-mapping-tools.org/t/help-with-creating-oblique-mercator/1620/9 "2021-05-01T06:01:52Z")

</div>

Currently working on a PR with gallery examples for the oblique Mercator projections; I’m only able to pass regions using a string with `+r` and have the figure turn out as expected, and haven’t had any luck using a Python list. Is using a list possible or should the guidance for oblique Mercator figures be to use a string?
