-
Notifications
You must be signed in to change notification settings - Fork 390
Open
Description
I am trying to plt the global map with the coordinate of Robinson, whereas the gl.right_labels = False cannot disable the latitude labels on the right side of the gridlines. The labels 60˚N and 60˚S still exists in the right side.
The cartopy 0.25.0, numpy 2.3.5, matplotlib 3.10.8 and python 3.14.0 are used.
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(10, 5), dpi=300)
lon_center = 0
map_proj = ccrs.Robinson(central_longitude=lon_center)
data_proj = ccrs.PlateCarree(central_longitude=lon_center)
ax = fig.add_subplot(1, 1, 1, projection=map_proj)
ax.coastlines(linewidth=0.3)
gl = ax.gridlines(draw_labels=True, linewidth=1, color='gray', alpha=0.5, linestyle='--')
gl.top_labels = False
gl.right_labels = False