The contour lines on a heatmap don't exist: how edge enhancement fools the eye
A smooth-gradient heatmap sits in front of you, and someone points at a spot and says, "There's a clear dividing line here." But there is no such line in the…

A smooth-gradient heatmap sits in front of you, and someone points at a spot and says, "There's a clear dividing line here." But there is no such line in the data — the color scale maps continuously from low to high, and no single step is singled out. That line was added by the eye.
This phenomenon has a name in vision science: Mach bands. Put a gray gradient running from dark to bright on a screen, and most people will see a narrow band brighter than both sides at the light-dark transition, with a darker narrow band right next to it. Cover both sides of the gradient with a piece of paper, leaving only a small middle stretch, and that bright band often disappears. It is not in the pixels; it is in the processing of the visual system.
The mechanism is roughly this: neurons in the retina and early visual pathways have center-surround antagonistic receptive fields — light in the center excites, light in the surround inhibits. When a luminance ramp appears in the visual field, neurons on the bright side receive less inhibition from the dark-side surround, while neurons on the dark side receive more inhibition from the bright-side surround. Subtracting the two, the inflection of the ramp is amplified into a bright edge and a dark edge. The classic explanation attributes this to lateral inhibition, which is essentially contrast gain control: it makes the system more sensitive to edges, at the cost of uniform regions being processed.
Visualization happens to step right onto this mechanism. The human eye's sensitivity to luminance differences varies with spatial frequency, peaking at some intermediate frequency; color-scale inflections, segment boundaries, and points where the gradient direction changes fall exactly at the scale that is most easily reinforced. Screen gamma response and ambient light reflection add on top, so the same data will be reinforced into boundaries of different strengths on different devices.
The consequences are not just about whether it looks good. Readers will treat this nonexistent line as a threshold, believing that crossing it changes the nature of things. A smooth temperature field on a weather map may be read as having a front; a risk-grading map may be read as having a hard boundary. If the underlying data changes continuously, this structure is conjured out of nothing.
A safer approach: use explicitly binned colors and label the value range of each bin, so the boundary is declared rather than felt; or overlay real contour lines on the continuous gradient, letting readers know where the lines come from. If a continuous color scale must be used, at least state in the legend that it is continuous, and avoid high-contrast palettes at the inflection points.
The limitations should also be stated clearly. Mach bands are much weaker on images of pure hue change and low contrast, and can even be invisible; lateral inhibition is the classic explanation, but modern research holds that earlier gain control and later factors also take part, so it cannot be treated as the sole cause. Different monitors, ambient light, and viewing distance all change the perception. So one cannot say that every reader will misread it; one can only say that continuously graded maps easily induce a boundary illusion. This principle explains a perceptual bias, not an error in the data itself.