为什么图像周围的框架会留下不完整的角落?

Why does a frame around an image leave a corner incomplete?

在下面的最小示例中,我试图在图像周围放置边框。但是左下角仍然是空白的。需要做什么来填充它?

import matplotlib.pyplot as plt
import cartopy
import cartopy.crs as ccrs

plt.figure(figsize=(152, 90), dpi=10)
ax = plt.axes(projection=ccrs.PlateCarree(145))
land = cartopy.feature.NaturalEarthFeature('physical', 'land', scale='50m')
ocean = cartopy.feature.NaturalEarthFeature('physical', 'ocean', scale='50m')
ax.add_feature(land, facecolor='gray')
ax.add_feature(ocean, facecolor='black')
ax.patch.set_edgecolor('red')
ax.patch.set_linewidth('1000')  # exaggerated width for example
plt.savefig('islands.png', pad_inches=10)
plt.show()

输出:

补丁(即一个PathPatch)的默认capstyle'butt',设置为'projecting':

ax.patch.set_capstyle('projecting')