我在创建两个matplotlib.pyplot
hexbin
图之间遇到了一个问题,这意味着首先获得每个对应的hexbin
的值差,然后创建一个差hexbin
映射。在
为了给我的问题举一个简单的例子,假设地图1中的hexbin
的值是3,而在地图2中对应的hexbin
的值是2,我要做的是首先得到差值3–2=1,然后在一个新的六边形图中绘制,即差分图,在与地图1和地图2相同的位置。在
我的输入代码和输出图如下。有谁能给我一个解决这个问题的办法吗?在
谢谢你的时间!在
In [1]: plt.hexbin(lon_origin_df, lat_origin_df)
Out[1]: <matplotlib.collections.PolyCollection at 0x13ff40610>
^{pr2}$
可以使用
h.get_values()
从h=hexbin()
获取值,并使用h.set_values()
设置值,这样您就可以创建一个新的hexbin
,并将其值设置为其他两个值之间的差。例如:相关问题 更多 >
编程相关推荐