离线热图与地图背景 [英] Offline heat map with map background
本文介绍了离线热图与地图背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试查找是否可以为热图设置背景(作为2D图)?从文件中读取数据并绘制热图(这非常简单),但是在离线模式下,我们可以将热图强加到真实图上吗?
I am trying to find if we can have background set (as 2D map) for a heat map ? Read data from a file and plot heat map (which is pretty simple) But in offline mode can we have the heat map imposed on the real map ?
任何有用的建议表示赞赏.
Any useful suggestion appreciated.
推荐答案
您使用热图使用底图作为地理地图的背景(我想这是您要问的问题) >和 imshow .
You use a heat map as the background for a geographical map (which I think is what you are asking about) using basemap and imshow.
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
m.drawcoastlines(linewidth=0.25)
data = 100*np.random.rand(10,10)
m.imshow(data, interpolation = 'none')
plt.show()
这篇关于离线热图与地图背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文