Matplotlib's scatter method allows one to pass a c= argument which takes an array of values that is then mapped to color via a colormap. We could so something similar here. I think this could be done as follows:
Implement support for weights in fast-histogram
Call the histogram with c as the weights
Map the result with the specified colormap
This is an approximation - in practice there's no reason that the average color in a pixel would be the color of the average, but the above is by far the fastest way to do this.
Matplotlib's scatter method allows one to pass a
c=
argument which takes an array of values that is then mapped to color via a colormap. We could so something similar here. I think this could be done as follows:c
as the weightsThis is an approximation - in practice there's no reason that the average color in a pixel would be the color of the average, but the above is by far the fastest way to do this.