Ländergrenzen in Cartopy zeichnen

English Deutsch

Verwenden

how-to-draw-country-borders-in-cartopy.py
import cartopy.crs as ccrs
import cartopy.feature as cf
from matplotlib import pyplot as plt
ax = plt.axes(projection = ccrs.Mercator())
# Dies fügt Grenzen hinzu
ax.add_feature(cf.BORDERS)

Der folgende Code zeigt ein Minimalbeispiel, wie man Ländergrenzen (und Küstenlinien) mit Cartopy darstellt:

cartopy_borders_complete.py
import cartopy.crs as ccrs
import cartopy.feature as cf
ax = plt.axes(projection = ccrs.Mercator())
ax.add_feature(cf.COASTLINE)
ax.add_feature(cf.BORDERS)
# Abbildung vergrößern
plt.gcf().set_size_inches(20, 10)

# Abbildung als SVG speichern
plt.savefig("Cartopy-Borders.svg")

Cartopy-Karte mit Ländergrenzen und Küstenlinien in Mercator-Projektion


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