在下面的最小示例中,我試圖在影像周圍放置邊框。但是左下角仍然是空白的。需要做什么來填充它?
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()
輸出:

uj5u.com熱心網友回復:

轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/383656.html
標籤:Python matplotlib 卡托皮
