The ability to manipulate optical fields and the energy flow of light is central to modern information and communication technologies, as well as quantum information processing schemes. However, because photons do not possess charge, a way of controlling them efficiently by electrical means has so far proved elusive. A promising way to achieve electric control of light could be through plasmon polaritons—coupled excitations of photons and charge carriers—in graphene. In this two-dimensional sheet of carbon atoms, it is expected that plasmon polaritons and their associated optical fields can readily be tuned electrically by varying the graphene carrier density. Although evidence of optical graphene plasmon resonances has recently been obtained spectroscopically, no experiments so far have directly resolved propagating plasmons in real space. Here we launch and detect propagating optical plasmons in tapered graphene nanostructures using near-field scattering microscopy with infrared excitation light. We provide real-space images of plasmon fields, and find that the extracted plasmon wavelength is very short—more than 40 times smaller than the wavelength of illumination. We exploit this strong optical field confinement to turn a graphene nanostructure into a tunable resonant plasmonic cavity with extremely small mode volume. The cavity resonance is controlled in situ by gating the graphene, and in particular, complete switching on and off of the plasmon modes is demonstrated, thus paving the way towards graphene-based optical transistors. This successful alliance between nanoelectronics and nano-optics enables the development of active subwavelength-scale optics and a plethora of nano-optoelectronic devices and functionalities, such as tunable metamaterials, nanoscale optical processing, and strongly enhanced light–matter interactions for quantum devices and biosensing applications.