You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an option to change the default x or longitude positions of inline latitude labels, particularly when using projections like Orthographic? Here's an example of what the current behavior is:
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(projection=ccrs.Orthographic(200, 67))
gl = ax.gridlines(draw_labels=True, y_inline=True, x_inline=False)
ax.add_feature(cartopy.feature.OCEAN)
# disable set extent for now
# ax.set_extent([170, 215, 58, 75], crs=ccrs.PlateCarree())
plt.show()
which results in this figure as expected:
The issue of inline latitude placement becomes noticeable when an extent is applied to zoom in using, for example, ax.set_extent([170, 215, 58, 75], crs=ccrs.PlateCarree()) which then produces this image:
The latitude labels go missing, essentially, because they are placed on the 90/-90 meridian (which I found via gl.label_artists). There are a couple of workarounds on StackOverflow like this one here but they didn't work for me and they seem like temporary fixes anyway. Is there a way to set the x coordinate of the latitude labels when they are inline, ideally regardless of if the extent is set or not? I'm not sure if this is also an issue with other projections or just the Orthographic.
Is there an option to change the default
x
or longitude positions of inline latitude labels, particularly when using projections like Orthographic? Here's an example of what the current behavior is:which results in this figure as expected:
The issue of inline latitude placement becomes noticeable when an extent is applied to zoom in using, for example,
ax.set_extent([170, 215, 58, 75], crs=ccrs.PlateCarree())
which then produces this image:The latitude labels go missing, essentially, because they are placed on the 90/-90 meridian (which I found via
gl.label_artists
). There are a couple of workarounds on StackOverflow like this one here but they didn't work for me and they seem like temporary fixes anyway. Is there a way to set the x coordinate of the latitude labels when they are inline, ideally regardless of if theextent
is set or not? I'm not sure if this is also an issue with other projections or just the Orthographic.Package versions
Python == 3.11.11
numpy == 1.26.0
matplotlib == 3.9.2
cartopy == 0.23.0
The text was updated successfully, but these errors were encountered: