[Python] Cartopy doesn't render left and right longitude labes

Discussão em 'Python' iniciado por Stack, Janeiro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm using cartopy to draw a geomap. This is how I set up graticule rendering:

    if graticule:
    gl = ax.gridlines(
    draw_labels=True,
    linewidth=0.8,
    color='gray',
    alpha=0.5,
    linestyle='--',
    x_inline=False,
    y_inline=True
    )

    gl.xlocator = mticker.FixedLocator(np.arange(-180, 181, 10))
    gl.ylocator = mticker.FixedLocator(np.arange(0, 91, 10))

    gl.top_labels = False
    gl.bottom_labels = True
    gl.left_labels = True
    gl.right_labels = True
    gl.xlabel_style = {'size': 10, 'color': 'gray'}
    gl.ylabel_style = {'size': 10, 'color': 'gray'}


    cartopy doesn't draw longitude labels to the left and to the right of the map. Only bottom and top (if on) labels are drawn: [​IMG]

    With ax.set_extent([0, 40, 75, 85], crs=ccrs.PlateCarree()) added: [​IMG]

    Latitude labels are okay being inline.

    Continue reading...

Compartilhe esta Página