Ask students to line up along a line, which will be the x-axis. (The line at the middle of a basketball court works well, but any line will do.) They should all face in the same direction. The middle student will be 0, and students on his or her right will be 1, 2, 3, etc., while students on the left will be -1, -2, -3, etc. Then, say:
"y = 3, everyone takes 3 steps forward" (Pause, so the students can see where they are standing)
"Go back to the x-axis" (Pause)
"y = -2, everyone takes 2 steps backward" (Pause)
"Go back to the x-axis"
These initial two maneuvers should help students calibrate their steps with their neighbors, so that they end up on a line parallel to the x-axis with each.
Now say:
"y = 2x, everyone step 2 times your number -- forward or back, depending on whether 2 times your number is positive or negative!"
Presumably, students will be standing on the graph of y = 2x.
And so on, with different functions.
Depending on the functions you intend to use, you may allow students to bring paper and pencil and/or calculators in case they need to make calculations.
Note that for functions such as $x^2$ or $2^x$ you will need a lot of space!