How does an electron beam move in XY mode?
Normally the horizontal (X) deflection is driven by a sawtooth wave, and the amount of deflection is determined by the voltage of the signal. This causes the beam to start at the left of the screen and move towards the right, and then snap back to the left when it has reached the rightmost point.

If we use a different arbitrary wave then we can cause it to move in a different manner; a triangle wave will move it back and forth, a sine wave will cause it to move slower towards the edges and faster near the center, and so on. By combining this with the vertical (Y) deflection we can cause complex shapes to be traced out on the screen.