10.02 使用 cartopy 画地图

使用 cartopy 画地图

安装 cartopy

最简单的方式是通过 conda 来进行安装:

conda install -c scitools cartopy

也可以下载下来自己编译。

简单使用

绘制一幅世界地图:

 1%matplotlib inline
 2
 3import cartopy.crs as ccrs
 4import matplotlib.pyplot as plt
 5
 6f = plt.figure(figsize=(16,9))
 7ax = plt.axes(projection=ccrs.Robinson())
 8ax.stock_img()
 9
10plt.show()

png