我有一个kdeplot,我想覆盖在谷歌地图底图之上
sns.kdeplot(dailyreport.long, dailyreport.lat,
cmap="Reds", shade=True, shade_lowest=False, alpha=.50)
plt.figure(figsize = (12, 12))
img = cimgt.GoogleTiles()
ax = plt.axes(projection = img.crs)
ax.set_extent([-76.849,-77.221,39.017,38.771])
ax.add_image(img, 12)
上述代码导致: Above code result
如何让热图位于谷歌地图的顶部
感谢您的帮助
seaborn抽象掉matplotlib接口的方式,恐怕它不能直接与cartopy一起工作geoplot声称是cartopy的seaborn等价扩展
geoplot的其中一个示例库是kde热图,它看起来像您想要的:
https://residentmario.github.io/geoplot/gallery/plot_boston_airbnb_kde.html#sphx-glr-gallery-plot-boston-airbnb-kde-py
我想出来了。我不得不使用
transform=ccrs.PlateCarree()
在地图上投影kdeplotFinal Output image
相关问题 更多 >
编程相关推荐