Python中的内核密度估计热图
问题描述:
我有一个纬度和经度坐标的列表,以及每个坐标处的相应接收信号强度值.如何在python(matplotlib)中的每个纬度上绘制这些信号强度的内核密度估计(kde)二维热图?
I have a list of latitude and longitude coordinates and respective Received Signal strength values at each coordinate. How would I plot a kernel density estimation (kde) 2D heatmap for these signal strengths at each lat-lon in python(matplotlib)?
答
您可以使用python库 seaborn .它具有方便的功能,可以为您的热图绘制内核密度估计.
You can use the python library seaborn. It has a handy function that plots kernel density estimation for your heatmaps.
检查一下:
import seaborn as sns
lat = [list_of_values]
long = [list_of_values]
ax = sns.kdeplot(lat, long, cmap="Blues", shade=True, shade_lowest=False)