mirror of
https://github.com/apachecn/ailearning.git
synced 2026-02-09 05:15:28 +08:00
33 lines
642 KiB
Markdown
33 lines
642 KiB
Markdown
# 使用 cartopy 画地图
|
||
|
||
## 安装 cartopy
|
||
|
||
最简单的方式是通过 [conda](http://conda.pydata.org/miniconda.html) 来进行安装:
|
||
|
||
```py
|
||
conda install -c scitools cartopy
|
||
```
|
||
|
||
也可以下载下来自己编译。
|
||
|
||
## 简单使用
|
||
|
||
绘制一幅世界地图:
|
||
|
||
In [1]:
|
||
|
||
```py
|
||
%matplotlib inline
|
||
|
||
import cartopy.crs as ccrs
|
||
import matplotlib.pyplot as plt
|
||
|
||
f = plt.figure(figsize=(16,9))
|
||
ax = plt.axes(projection=ccrs.Robinson())
|
||
ax.stock_img()
|
||
|
||
plt.show()
|
||
|
||
```
|
||
|
||
 |