Küstenlinien oder Grenzlinien in Cartopy dicker machen (Linienbreite)
English
Deutsch
Standardmäßig zeichnet Cartopy jedes Feature mit derselben Linienbreite:
cartopy_linewidth.py
ax.add_feature(cf.COASTLINE)
ax.add_feature(cf.BORDERS)Die Linienbreite kann leicht erhöht werden, indem z.B.
lw=2 zum ax.add_feature()-Aufruf hinzugefügt wird:
cartopy_linewidth_complete.py
ax.add_feature(cf.COASTLINE, lw=2)
ax.add_feature(cf.BORDERS)Vollständiges Codebeispiel
Dieses Beispiel erzeugt das Bild mit einer breiteren Küstenlinienbreite wie oben gezeigt
cartopy_linewidth_save_example.py
import cartopy.crs as ccrs
import cartopy.feature as cf
from matplotlib import pyplot as plt
proj = ccrs.PlateCarree()
ax = plt.axes(projection=proj)
ax.set_extent([-23, 55, -35, 40])
ax.stock_img()
ax.add_feature(cf.COASTLINE, lw=2)
ax.add_feature(cf.BORDERS)
# Abbildung vergrößern
plt.gcf().set_size_inches(20, 10)
# Abbildung als SVG speichern
plt.savefig("Africa-Standard.svg")If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow