How rotate coordinates labels in Pygmt

Hello everyone, I would like to ratate the coordinates labels to my pygmt map, anyone know how to make it? The next is my code. Thank you all

import pygmt
import pandas as pd
import os

fig = pygmt.Figure()

pygmt.config(GMT_LANGUAGE="ES") # Para cambiar al lenguaje español
pygmt.config(MAP_GRID_PEN="00") # Para cambiar el color de la grilla a gris claro

fig.coast(borders=['1/0.6p','2/0.2p,#6D6D6D'],region=[-104,-97,15,19], frame=["a","WSne"], land="8/5/12/15", water="0/0/7/0",projection="Cyl_stere/-180/-40/25c")

fig.savefig('/home/miguel/NUBE/Python/Mapas/Figuras/prueba.pdf')        
fig.show(width=1000)

1 Like

Since you’re plotting geographic longitude/latitude coordinates, you’ll need to set MAP_ANNOT_OBLIQUE to lat_parallel like so:

with pygmt.config(MAP_ANNOT_OBLIQUE="lat_parallel"):
    fig.coast(
        borders=["1/0.6p", "2/0.2p,#6D6D6D"],
        region=[-104, -97, 15, 19],
        frame=["a", "WSne"],
        land="8/5/12/15",
        water="0/0/7/0",
        projection="Cyl_stere/-180/-40/25c",
    )

produces:

Now if you were plotting on a Cartesian frame, you would use MAP_ANNOT_ORTHO instead, or use +ap in the frame/-B argument (see gmt — GMT 6.4.0 documentation).