The piston is driven up and down in the cylinder.
The changes are plotted, as they happen, on the PV diagram.