目录

Python Geographical Data

现在已经创建了许多开源python库来表示地理地图。 它们是高度可定制的,并提供各种各样的地图,描绘不同形状和颜色的区域。 一个这样的包是Cartopy。 您可以从Cartopy在本地环境中下载并安装此软件包。 您可以在其库中找到大量示例。

在下面的例子中,我们展示了世界地图的一部分,显示了亚洲和澳大利亚的部分地区。 您可以调整方法set_extent中参数的值,以定位世界地图的不同区域。

import matplotlib.pyplot as plt
import cartopy.crs as ccrs    
fig = plt.figure(figsize=(15, 10))
ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
    # make the map global rather than have it zoom in to
    # the extents of any plotted data
ax.set_extent((60, 150, 55, -25))
ax.stock_img()
ax.coastlines()
ax.tissot(facecolor='purple', alpha=0.8)
plt.show()

output如下 -

geographic.png
<上一篇.Python Time Series
Python Graph Data.下一篇>
↑回到顶部↑
WIKI教程 @2018