Hacker News new | past | comments | ask | show | jobs | submit login

It boils down to the (very reasonable) way alpha blending works. Alpha was originally designed to always lie between zero and one, which for compositing makes sense. For scatterplot colormapping, not so much:

If you create a plot with opacity alpha, and which puts N points on top of each other, the remaining 'transparency', that is, the resulting opacity is

1 - (1 - alpha)^N

This is an exponential, which has the unfortunate feature that it's flat for most of the regime, and then spikes in a relatively short scale. The spike is where we get color differentiation (different opacities get different colors). That's bad: color differentiation should be uniform across the scale.

I'm pretty certain Mathematica doesn't do this right either, because it's a pixel-based technique that requires frame buffer manipulation. Instead of rendering with the usual blending operation, you do everything with additive blending, compute the maximum overdraw, and then color-scale linearly.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact