# How to set the annotation of X axis as Latitude when I use oblique projection

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [March 26, 2024, 5:43pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751 "2024-03-26T17:43:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 26, 2024, 5:43pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/1 "2024-03-26T17:43:52Z")

</div>

Hello guys,

I would like to plot a gravity map using oblique projection and would like to show the annotation of X axis as latitude. But the annotation of X axis always shows longitude (see attached figure please). How could I change that? It worked well when I used GMT6.0. Now I am using GMT6.5. Many thanks!

 ![Gravity](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/1/198486ccc19edddffb2b6888474df2934f7c1b03.png)

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forum.generic-mapping-tools.org/u/Andreas)\
**Post date:** [March 26, 2024, 6:11pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/2 "2024-03-26T18:11:18Z")

</div>

Please share script. If it worked with 6.0 it should work with 6.5 as well.

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 26, 2024, 6:19pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/3 "2024-03-26T18:19:53Z")

</div>

Hi Andreas, thanks. I used:  
`gmt grdimage Gravity.grd -CGravity.cpt -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1`

---

<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:** [March 26, 2024, 7:30pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/4 "2024-03-26T19:30:41Z")

</div>

and who can reproduce this?

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 26, 2024, 7:53pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/5 "2024-03-26T19:53:10Z")

</div>

I am so sorry!

The script is:

makecpt -Cjet -T-200/250 \> Gravity.cpt  
gmt begin Gravity png  
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1  
gmt grdimage @earth\_faa\_01m -CGravity.cpt  
gmt end show

Many thanks!

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [March 26, 2024, 8:11pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/6 "2024-03-26T20:11:06Z")

</div>

Hello @GEOS,

as already mentioned your code example can not be reproduced as we do not have your gravity data and cpt. Thus, I am using the Earth relief data from the GMT remote datasets in my examples.

I am not sure if I get your questions correctly, but for me it sounds like the map should be rotated by 90°, which can be achieved by [**-p**](https://docs.generic-mapping-tools.org/latest/gmt.html#perspective-full), i.e., from

```bash
gmt begin lon_lat
    gmt grdimage @earth_relief -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1
gmt end

```

 ![lon_lat](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/2/25e01bc0f2f4d97d88914bed213da1a59d2d8f6e.png)

to (alternatively `-p270/90`)

```bash
gmt begin lat_lon
    gmt grdimage @earth_relief -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1 -p90/90
gmt end

```

 ![lat_lon_01](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/7c45f61c39e0495dc365c6fda6c20cffc82cab17.png)

---

<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:** [March 26, 2024, 8:25pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/7 "2024-03-26T20:25:25Z")

</div>

I’m afraid something broke in time.

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1 -png lixo

```

GMT6.1

 ![lixo](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/b/b78c2e833b23dcab24c0fee6f79a8a069a49da8d.png)

GMT6.2

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

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 26, 2024, 8:41pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/8 "2024-03-26T20:41:25Z")

</div>

Hi @Joaquim ,

Thanks. I plotted the required map using GMT6.0, but I could not construct it using GMT6.5. So I posted it in case it is a bug.

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 26, 2024, 8:44pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/9 "2024-03-26T20:44:41Z")

</div>

Hello @yvonnefroehlich ,

Many thanks for you suggestion.

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [March 27, 2024, 1:44am UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/10 "2024-03-27T01:44:40Z")

</div>

`+v` kind of makes the frame working on gmt 6.5.0. Not sure this is useful, but anyway:

```auto
gmt grdimage @earth_relief -JOb168/51/172/32.5/4c+v -R-500/2300/-400/400+uk \
-BeNsW -Bxa5f1 -Bya5f1 -png quick --MAP_FRAME_TYPE=plain

```

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

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [March 27, 2024, 9:43am UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/11 "2024-03-27T09:43:58Z")

</div>

Dear all, I misunderstood this issue 🙁.  
As I did not know this study area in more detail, I did not get that the annotations set by GMT are mixed up regarding the West-East and South-North directions!  
I thought the whole plot should be rotated and assumed the annotations to be correct.

Interestingly, the annotations are correct when using `+v` as suggested by @mkononets.

As it is reported that it worked with GMT 6.1, I feel @Joaquim is correct, that something broke over time and needs a fix on the GMT side…

@GEOS Maybe using both `+v` and `-p270/90` is a workaround and produces the desired plot:

```bash
gmt begin lat_lon_v
    gmt grdimage @earth_relief -JOb168/51/172/32.5/14c+v -R-500/2300/-400/400+uk -Ggray -BeNsW -Bxa5f1 -Bya5f1 -p270/90
gmt end

```

 ![lat_lon_v](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/4/4341f720bbb24ea97aa9e08eb301b0d4d570750b.jpeg)

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 27, 2024, 10:38am UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/12 "2024-03-27T10:38:38Z")

</div>

Hi @yvonnefroehlich and @mkononets ,

Many thanks for the workaround. It works well.

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [March 27, 2024, 1:23pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/13 "2024-03-27T13:23:23Z")

</div>

explicitly specifying `--MAP_ANNOT_OBLIQUE=anywhere` seems solving the map frame annotation placement issue in gmt 6.5.0:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1 -png quick --MAP_FRAME_TYPE=plain --MAP_ANNOT_OBLIQUE=anywhere

```

 ![quick](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c75f89abfc05cb68914e6632200fba9b955f5b17.png)

the documentation says it should be there as a default [gmt.conf — GMT 6.6.0 documentation](https://docs.generic-mapping-tools.org/latest/gmt.conf.html#term-MAP_ANNOT_OBLIQUE) but somehow this was not the case

@yvonnefroehlich  
I did not understand the problem either until @Joaquim posted the frames

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 27, 2024, 1:38pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/14 "2024-03-27T13:38:23Z")

</div>

Nice job! Many thanks!

---

<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:** [March 27, 2024, 3:03pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/15 "2024-03-27T15:03:30Z")

</div>

Nice finding. We must capture all this in an issue.

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 27, 2024, 3:34pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/16 "2024-03-27T15:34:35Z")

</div>

@Joaquim Find another issue with the font of annotation of colorbars:

 ![Bathymetry_gravity](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/4/41060d8a6b631a4c15a7f959e8e2ac81c7b3846d.jpeg)

I tried to set the font larger but it did not work (in GMT6.5):

```auto
gmt set FONT 12,Times-Roman
gmt set MAP_ANNOT_OBLIQUE anywhere

gmt begin gravity png
gmt grdimage @earth_faa_01m -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BeNsW -Bxa5f1 -Bya5f1
gmt colorbar -C -Dx14.2c/2c+jML+w3c/0.2c+mc -Ba100f50 -By+lmGal
gmt colorbar -C -Dx7c/-0.2c+jTC+w6c/0.2c+mc+h -Ba100f50 -By+lmGal
gmt end show

```

It works well in GMT 6.4…

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [March 27, 2024, 11:10pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/17 "2024-03-27T23:10:36Z")

</div>

> [@GEOS](#):
>
> @Joaquim Find another issue with the font of annotation of colorbars:

@GEOS can you please open a new topic for this issue, so that we can focus on the annotation issue for oblique projections in this topic.

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [March 27, 2024, 11:42pm UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/18 "2024-03-27T23:42:48Z")

</div>

I can try to write such an issue on GitHub in the GMT repository.

I just looked at the example we have in the PyGMT documentation at [https://www.pygmt.org/dev/projections/cyl/cyl\_oblique\_mercator\_2.html](https://www.pygmt.org/dev/projections/cyl/cyl_oblique_mercator_2.html). Here, using `+v` leads to wrong annotations.

```bash
gmt coast -JOb130/35/25/35/6c -R130/35/145/40+r -Ggray -BWSNE -Bxa5f1g5 -Bya2f1g2 -png lon_lat_02

```

 ![lon_lat_02](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/a/a75713e843e6a361c9e89b75e31ab8f8c5aac2c8.png)

```bash
gmt coast -JOb130/35/25/35/6c+v -R130/35/145/40+r -Ggray -BWSNE -Bxa5f1g5 -Bya2f1g2 -png lon_lat_v_02

```

 ![lon_lat_v_02](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/2/276bd0804a427cf2e41959382e52092dcf7967c9.png)

```bash
gmt coast -JOb130/35/25/35/6c -R130/35/145/40+r -Ggray -BWSNE -Bxa5f1g5 -Bya2f1g2 --MAP_ANNOT_OBLIQUE=anywhere -png lon_lat_anywhere_02

```

 ![lon_lat_anywhere_02](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/7/75127d89adc651ebcf92acb77494652f9528ae0d.png)

```bash
gmt coast -JOb130/35/25/35/6c+v -R130/35/145/40+r -Ggray -BWSNE -Bxa5f1g5 -Bya2f1g2 --MAP_ANNOT_OBLIQUE=anywhere -png lon_lat_v_anywhere_02

```

 ![lon_lat_v_anywhere_02](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/9/9ba57ee9ada05c9551a0aa5ff36b0923b924b71b.png)

**Edit 2024/03/28** : Opened an issue at [Oblique projection (Ob): Partly wrong annotations · Issue #8418 · GenericMappingTools/gmt · GitHub](https://github.com/GenericMappingTools/gmt/issues/8418).

---

<div class="post-metadata">

**Author:** ![GEOS](https://avatars.discourse-cdn.com/v4/letter/g/c0e974/32.png) [@GEOS](https://forum.generic-mapping-tools.org/u/GEOS)\
**Post date:** [March 28, 2024, 12:50am UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/19 "2024-03-28T00:50:33Z")

</div>

Hi @yvonnefroehlich ,  
New topic created. Thanks.

---

<div class="post-metadata">

**Author:** ![mkononets](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/mkononets/32/4029_2.png) [@mkononets](https://forum.generic-mapping-tools.org/u/mkononets)\
**Post date:** [March 28, 2024, 10:50am UTC](https://forum.generic-mapping-tools.org/t/how-to-set-the-annotation-of-x-axis-as-latitude-when-i-use-oblique-projection/4751/20 "2024-03-28T10:50:44Z")

</div>

some more re. the funny tick and annotation placement

`--MAP_ANNOT_OBLIQUE=anywhere` actually produces many extra ticks w/o annotations not visible until the ticks are drawn long enough `--MAP_TICK_LENGTH_PRIMARY=20p/10p`:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BWesN -Bxa5f1g5 -Bya5f1g5 --MAP_FRAME_PEN=auto,red --MAP_TICK_LENGTH_PRIMARY=20p/10p --MAP_GRID_PEN=auto,grey --MAP_ANNOT_OBLIQUE=anywhere -png quick

```

 ![quick](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/88d1e438c2f3a0c8041d923851556805a90e36dd.png)

here all ticks and labels as expected, using `--MAP_ANNOT_OBLIQUE=anywhere,tick_extend`:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BWesN -Bxa5f1g5 -Bya5f1g5 --MAP_FRAME_PEN=auto,red --MAP_TICK_LENGTH_PRIMARY=20p/10p --MAP_GRID_PEN=auto,grey --MAP_ANNOT_OBLIQUE=anywhere,tick_extend -png quick

```

 ![quick](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/897ac2046455d8cfc0be51458aea5d6d443e53b0.png)

the original tick placement, `gmtdefaults` says `MAP_ANNOT_OBLIQUE` is `separate,lon_horizontal,lat_horizontal,tick_extend`, ticks missing, tick annotations “far away” as specified by `--MAP_TICK_LENGTH_PRIMARY` and `tick_extend`:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BWesN -Bxa5f1g5 -Bya5f1g5 --MAP_FRAME_PEN=auto,red --MAP_TICK_LENGTH_PRIMARY=20p/10p --MAP_GRID_PEN=auto,grey -png quick

```

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

as above, but without `tick_extend`:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BWesN -Bxa5f1g5 -Bya5f1g5 --MAP_FRAME_PEN=auto,red --MAP_TICK_LENGTH_PRIMARY=20p/10p --MAP_GRID_PEN=auto,grey --MAP_ANNOT_OBLIQUE=separate,lon_horizontal,lat_horizontal -png quick

```

 ![quick](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/1/1719bd1ca014fa18203d6f2478daa2810b494e34.png)

`--MAP_ANNOT_OBLIQUE=separate,lon_horizontal`:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BWesN -Bxa5f1g5 -Bya5f1g5 --MAP_FRAME_PEN=auto,red --MAP_TICK_LENGTH_PRIMARY=20p/10p --MAP_GRID_PEN=auto,grey --MAP_ANNOT_OBLIQUE=separate,lon_horizontal -png quick

```

 ![quick](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/c/c666dae44c4e0567bc8b3125ea486bb4cd7b3775.png)

`--MAP_ANNOT_OBLIQUE=separate,lat_horizontal`, longitude annotations (175 E) is missing:

```auto
gmt basemap -JOb168/51/172/32.5/14c -R-500/2300/-400/400+uk -BWesN -Bxa5f1g5 -Bya5f1g5 --MAP_FRAME_PEN=auto,red --MAP_TICK_LENGTH_PRIMARY=20p/10p --MAP_GRID_PEN=auto,grey --MAP_ANNOT_OBLIQUE=separate,lat_horizontal -png quick

```

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