Offline heat map with map background

后端 未结 1 1929
粉色の甜心
粉色の甜心 2021-01-25 08:00

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 t

相关标签:
1条回答
  • 2021-01-25 08:11

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

    map with heatmap

    0 讨论(0)
提交回复
热议问题