To be precise, the wave functions above are examples of standing (or stationary) waves, while a photon is a traveling wave: just extend that sine and cosine function in both directions if you???d want to visualize it or, even better, think of a sine and cosine function in an envelope traveling through space, such as the one depicted below.