'Matplotlib Hexbin with 2-parameter Colormap

In the question: Matplotlib Colormap with two parameter a code has been provided to produce a circle plot with a colormap depending on 2 parameters. I'm looking to reproduce this using Matplotlib.pyplot.hexbin() . Goal is to produce hexbins, that change color according to a certain input parameter and change the transparency according to the count of the datapoints in the hexbins. I also thought about varying the alpha parameter, but it only accepts constant values. Another idea would be to plot only partial maps with hexbins within a certain count range each (e.g. 1-10), for example if there was an equivalent 'maxcnt'-attribute to the 'mincnt'-attribute.

Any ideas on how this could be done?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source