(a) Heatmap of fly turning velocity during the first 0.5 s of sinusoidal grating stimulation under high-contrast conditions and variable temporal and spatial frequencies. The flies turned in the direction of the stimulus across all conditions and responded most to 8 Hz, 22° stimuli. N=16, 21, 17, 21, 7, and 22 flies for spatial frequencies 1/120°, 1/90°, 1/60°, 1/45°, 1/30°, and 1/22° respectively. (b) Heatmap as in (a), measured during the last 4 s of stimulation. Flies turned in the same direction as the stimulus at high and low temporal frequencies, but in the opposite direction of the stimulus at intermediate temporal frequencies, with a maximal anti-directional response at wavelengths between 30° and 60°. (c) Switching stimulus contrast from high to low after 5 s caused flies to revert to syn-directional behavior after the anti-directional response. N=7 flies. (d) Presenting rotating random binary patterns (5° vertical strips rotating at 150 °/s) induced anti-directional turning similar to that elicited by rotating sine wave gratings. N=7 flies. (e) We presented flies with 5 s of ‘translational’ stimuli (dark shaded region), with high-contrast sinusoidal gratings moving either front-to-back or back-to-front, bilaterally, for 5 s. After that, we presented high-contrast rotational sinusoidal grating stimuli (60° wavelength, 1 Hz). Front-to-back stimulation did not affect the subsequent response to rotational stimuli, but back-to-front stimuli caused flies to turn immediately in the opposite direction of the stimulus. N=18 flies.