我在创建两个 matplotlib.pyplot hexbin 图之间的差异图时遇到了问题,这意味着首先要获取每个对应的 hexbin 的值差异,然后创建一个差异的 hexbin 图。为了给出我的问题的简单示例,假设 Map 1 中一个 hexbin 的值为 3,Map 2 中对应的 hexbin 的值为 2,我想做的是首先得到差异 3-2=1,然后在与 Map 1 和 Map 2 相同的位置上绘制它,即一个新的 hexbin 差异图。以下是我的输入代码和输出图。请问有人能给我解决这个问题的方法吗?感谢您的时间!
In [1]: plt.hexbin(lon_origin_df, lat_origin_df)
Out[1]: <matplotlib.collections.PolyCollection at 0x13ff40610>
In [2]: plt.hexbin(lon_termination_df, lat_termination_df)
Out[2]: <matplotlib.collections.PolyCollection at 0x13fff49d0>
hexbin
的分箱逻辑与当前代码中创建多边形集合不可分。 - fjarri