Благодаря ответу на этот вопрос Я могу построить карту мира геопанд с разноцветными континентами и океанами в разных проекциях.
Теперь я хотел бы добавить несколько точек, например, городавключены в геопанды
cities = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))
К сожалению, города покрыты заполненными континентами.Есть ли способ сделать эти города спереди или сверху карты?
Мой текущий код выглядит так:
facecolor = 'sandybrown'
edgecolor = 'black'
ocean_color = '#A8C5DD'
crs1 = ccrs.NorthPolarStereo()
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
cities = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))
w1 = world.to_crs(crs1.proj4_init)
c1 = cities.to_crs(crs1.proj4_init)
fig1, ax1 = plt.subplots(figsize=(7,7), subplot_kw={'projection': crs1})
# useful code to set map extent,
# --- if you want maximum extent, comment out the next line of code ---
ax1.set_extent([-60.14, 130.4, -13.12, -24.59], crs=ccrs.PlateCarree())
# at maximum extent, the circular bound trims map features nicely
ax1.add_geometries(w1['geometry'], crs=crs1, facecolor=facecolor, edgecolor=edgecolor, linewidth=0.5)
# this adds the ocean coloring
ax1.add_feature(cartopy.feature.OCEAN, facecolor=ocean_color, edgecolor='none')
# this adds the cities
c1.plot(ax=ax1, marker='o', color='red', markersize=50)
Результат выглядит так:
![enter image description here](https://i.stack.imgur.com/Yny2q.png)