a, Setup for two-photon imaging in behaving flies. Insets: Schematic of fly tethered in flying holder, and positioned on air-supported ball in walking holder. b, Subset of simultaneously recorded R2 neurons during walking. Starred boxes: responses to identical visual stimuli when fly is stationary versus walking. Azimuthal position of visual stimulus shown in e (bottom). c, Distributions of R4d neuron visual responses during walking and non-walking conditions are not significantly different (n = 14 flies, trialswalking = 1722, trialswalking<50% = 42, meanwalking = 0±44.3, meanwalking<50% = 1.1±49.7, p = 0.45). d, Same as c for R2 neurons (n = 8 flies, trialswalking = 2015, trialswalking<50% = 245, meanwalking = 0±28.1, meanwalking<50% = −2.2±24.4, p = 0.37). e, Subset of simultaneously recorded R4d microglomeruli during flight. Starred boxes: diminished responses to identical visual stimuli during flight. f, Distributions of all R4d microglomeruli recorded shows significant shift towards lower responses during flight (n = 13 flies, trialsflying = 759, trialsflying<50% = 481, meanflying = 0±42.2, meanflying<50% = 31.2±72.3, p = 6·10−15). All p-values: two-sample Kolmogorov-Smirnov test.