I encountered a problem on creating a difference map between two matplotlib.pyplot
hexbin
plots, which means to get the value differences of each corresponding hexbin
first and then create a difference hexbin
map.
To give a simple example of my problem here, say the value of one hexbin
in Map 1 is 3 and the value of the corresponding hexbin
in Map 2 is 2, what I would like to do is to get the difference 3 – 2 = 1 first and then plot it in a new hexbin map, i.e. a difference map, at the same positions as Map 1 and Map 2.
My input codes and output plots are as follows. Could anyone please give me a solution to this problem?
Thanks for your time!
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>