带海岸线的 Cartopy 最小示例

此示例展示使用 cartopy 绘制海岸线的最小示例:

cartopy-minimal-example-with-coastlines.py
import cartopy.crs as ccrs
import cartopy.feature as cf
from matplotlib import pyplot as plt
ax = plt.axes(projection = ccrs.Mercator())
ax.add_feature(cf.COASTLINE)
# 使图更大
plt.gcf().set_size_inches(20, 10)

# 将图保存为 SVG
plt.savefig("Cartopy-Coastlines.svg")

使用 Mercator 投影显示海岸线的 Cartopy 最小地图


Check out similar posts by category: Cartopy, Geography, Python