Das bekomme ich von ChatGPT statt einer Karte:
"import matplotlib.pyplot as plt
import geopandas as gpd
from shapely.geometry import Point
# Länder mit Anerkennung Palästinas in Europa und Jahreszahl
recognizing_countries = {
"Bulgaria": 1988,
"Poland": 1988,
"Romania": 1988,
"Hungary": 1988,
"Cyprus": 1988,
"Sweden": 2014,
"Iceland": 2011,
"Norway": 2024,
"Ireland": 2024,
"Spain": 2024,
"Slovenia": 2024,
"Portugal": 2025,
"France": 2025,
"Malta": 2025,
"Luxembourg": 2025,
"United Kingdom": 2025
}
# Farben je nach Jahr der Anerkennung
def get_color(year):
if year <= 1988:
return '#006400' # Dunkelgrün
elif year <= 2014:
return '
#228B22' # Mittelgrün
else:
return '
#90EE90' # Hellgrün
# Weltkarte laden
world =
gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
# Nur Europa filtern
europe = world[world['continent'] == 'Europe']
# Koordinaten einiger Hauptstädte zur Platzierung der Flagge (vereinfacht)
capital_coords = {
"Bulgaria": (25.3, 42.7),
"Poland": (21.0, 52.2),
"Romania": (26.1, 44.4),
"Hungary": (19.0, 47.5),
"Cyprus": (33.4, 35.1),
"Sweden": (18.0, 59.3),
"Iceland": (-21.9, 64.1),
"Norway": (10.7, 59.9),
"Ireland": (-6.3, 53.3),
"Spain": (-3.7, 40.4),
"Slovenia": (14.5, 46.1),
"Portugal": (-9.1, 38.7),
"France": (2.3, 48.9),
"Malta": (14.5, 35.9),
"Luxembourg": (6.1, 49.6),
"United Kingdom": (-0.1, 51.5)
}
# Plot vorbereiten
fig, ax = plt.subplots(figsize=(15, 12))
europe.plot(ax=ax, color='lightgrey', edgecolor='black')
# Flaggen Jahreszahlen einfügen
for country, year in recognizing_countries.items():
if country in capital_coords:
x, y = capital_coords[country]
ax.plot(x, y, marker='o', color=get_color(year), markersize=10)
ax.text(x 0.3, y, f"🇵🇸 {year}", fontsize=9, verticalalignment='center')
# Titel und Legende
ax.set_title("Anerkennung Palästinas in Europa (mit Jahreszahl)", fontsize=16)
ax.axis('off')
# Legende (manuell)
legend_labels = [
("≤ 1988", '#006400'),
("2011–2014", '
#228B22'),
("2024–2025", '
#90EE90')
]
for i, (label, color) in enumerate(legend_labels):
ax.scatter([], [], color=color, label=label, s=100)
ax.legend(title="Jahr der Anerkennung", loc='lower left')
plt.tight_layout()
plt.savefig("anerkennung_palaestina_europa.png", dpi=300)
plt.show()
"