As the scale of microelectronic engineering continues to shrink, interest has focused on the nature of electron transport through essentially one-dimensional nanometre-scale channels such as quantum wires  and carbon nanotubes [2,3]. Quantum point contacts (QPCs) are structures (generally metallic) in which a 'neck' of atoms just a few atomic diameters wide (that is, comparable to the conduction electrons' Fermi wavelength) bridges two electrical contacts. They can be prepared by contacting a metal surface with a scanning tunnelling microscope (STM) [4-7] and by other methods [8-12], and typically display a conductance quantized in steps of 2e2/h ([tilde operator] 13 k Omega-1) [13,14], where e is the electron charge and h is Planck's constant. Here we report conductance measurements on metal QPCs prepared with an STM that we can simultaneously image using an ultrahigh-vacuum electron microscope, which allows direct observation of the relation between electron transport and structure. We observe strands of gold atoms that are about one nanometre long and one single chain of gold atoms suspended between the electrodes. We can thus verify that the conductance of a single strand of atoms is 2e2/h and that the conductance of a double strand is twice as large, showing that equipartition holds for electron transport in these quantum systems.