带有Cartopy的扩展欧洲地图

问题描述 投票:0回答:1

以下Python代码可以很好地展现西欧:

import matplotlib.pyplot as plt
import cartopy
import cartopy.io.shapereader as shpreader
import cartopy.crs as ccrs

plt.figure(figsize=(10, 10))
ax = plt.axes(projection=ccrs.EuroPP())
ax.add_feature(cartopy.feature.BORDERS, linestyle='-', alpha=1)
ax.coastlines(resolution='10m')
ax.add_feature(cartopy.feature.OCEAN,facecolor=(0.5,0.5,0.5))
ax.gridlines()

但是,将地图扩展到包括土耳其和其他高加索国家在内的东方的方式是什么?我是否需要在()EuroPP()中包含一些参数?我是否需要将projection=ccrs.EuroPP()更改为其他内容?找不到任何示例...

enter image description here

python cartopy
1个回答
0
投票
要获得具有相似投影的地图,请使用经度墨卡托,经度为32度的中央子午线,请尝试运行以下代码:

import cartopy import cartopy.crs as ccrs import matplotlib.pyplot as plt plt.figure(figsize=(9, 9)) ax = plt.axes(projection=cartopy.crs.TransverseMercator(32)) ax.add_feature(cartopy.feature.BORDERS, linestyle='-', alpha=1) ax.coastlines(resolution='110m') ax.add_feature(cartopy.feature.OCEAN, facecolor=(0.5,0.5,0.5)) ax.gridlines() ax.set_extent ((-7.5, 50, 34, 69), cartopy.crs.PlateCarree()) plt.show()

您将得到这样的情节:

europe_map

© www.soinside.com 2019 - 2024. All rights reserved.