79389687

Date: 2025-01-27 03:21:09
Score: 0.5
Natty:
Report link

It seems like solution from @Li Yupeng is okay, but maybe it is not the best option. Another choice is to set "alpha" parameter in gridlines() function to "0" to make it invisible.


Code part:

import matplotlib.pyplot as plt

import cartopy.crs as ccrs
import cartopy.feature as cfeature

fig = plt.figure(figsize = (14, 6))

ax1 = fig.add_subplot(1, 2, 1, projection = ccrs.PlateCarree())
ax1.coastlines(resolution='110m')
glLeft = ax1.gridlines(draw_labels=True)

ax2 = fig.add_subplot(1, 2, 2, projection = ccrs.PlateCarree())
ax2.coastlines(resolution='110m')
glRight = ax2.gridlines(draw_labels=True, alpha = 0)

plt.show()

Output: https://www.mediafire.com/view/c4qqie5web243d1/result.png/file

Hope it's useful :).

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Jw L