astrofrog / mpl-scatter-density

:zap: Fast scatter density plots for Matplotlib :zap:
BSD 2-Clause "Simplified" License
498 stars 25 forks source link

Make it possible to specify a color for each marker based on a third value #5

Closed astrofrog closed 6 years ago

astrofrog commented 7 years ago

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:

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.

astrofrog commented 6 years ago

Done in #11!