python 将标记,散点图和热图绘制到Google地图中。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 将标记,散点图和热图绘制到Google地图中。相关的知识,希望对你有一定的参考价值。

import gmplot

# data
pathlon = -117.2974695,-117.2980671,-117.2984607,-117.2979182,-117.2974082,-117.2966604,-117.2977518,-117.2987498,-117.2981491,-117.297708,-117.2972804,-117.2965301,-117.2979485,-117.2975028,-117.2980506,-117.2982983,-117.2976609,-117.2970861,-117.2969908,-117.2981731,-117.2987695,-117.2981146,-117.2976909,-117.2969674,-117.2969299,-117.298394
pathlat = 33.27172039,33.27197757,33.27217535,33.27225324,33.27218351,33.27233921,33.27242614,33.27248971,33.27268346,33.27265944,33.27263664,33.27279608,33.27281652,33.27194103,33.27176546,33.27224514,33.27222714,33.27208829,33.27237357,33.27243373,33.27262189,33.27268296,33.27265933,33.27262125,33.27282274,33.27283925

# build object
gmap = gmplot.GoogleMapPlotter(pathlat[0],pathlon[0],18)

# plot scatter
gmap.scatter(pathlat,pathlon, '#3B0B39', size=6, marker=False)

# plot markers
for i in range(len(pathlon)):
    lat, long = pathlat[i],pathlon[i]
    gmap.marker(lat,long,c='red')

# save map
gmap.draw('map.html')

以上是关于python 将标记,散点图和热图绘制到Google地图中。的主要内容,如果未能解决你的问题,请参考以下文章

Python 绘制线性回归散点图和置信区间线2

Python 绘制线性回归散点图和置信区间线2

Python 绘制线性回归散点图和置信区间线

Python 绘制线性回归散点图和置信区间线

Python 绘制线性回归散点图和置信区间线

根据 Seaborn 中的散点图绘制热图