Python数据可视化教程:高度可定制地理地图

2018-09-3009:30:44后端程序开发Comments2,900 views字数 499阅读模式

已经创建了许多开源python库来表示地理地图。 它们高度可定制,并提供各种地图,描绘不同形状和颜色的区域。 一个包是Cartopy。 可以从Cartopy的本地环境下载并安装此软件包。可以在画廊找到很多例子。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6064.html

在下面的例子中,我们展示了部分亚洲和澳大利亚的世界地图。 可以调整方法set_extent中的参数值以查找世界地图的不同区域。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6064.html

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()

执行上面示例代码,得到以下结果 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6064.html

Python数据可视化教程:高度可定制地理地图文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6064.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/bc/6064.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定