Bilayer graphene can be modified by rotating (twisting) one layer with respect to the other. The interlayer twist gives rise to a moiré superlattice that affects the electronic motion and alters the band structure1,2,3,4. Near a ‘magic angle’ of twist2,4, where the emergence of a flat band causes the charge carriers to slow down3, correlated electronic phases including Mott-like insulators and superconductors were recently discovered5,6,7,8 by using electronic transport. These measurements revealed an intriguing similarity between magic-angle twisted bilayer graphene and high-temperature superconductors, which spurred intensive research into the underlying physical mechanism9,10,11,12,13,14. Essential clues to this puzzle, such as the symmetry and spatial distribution of the spectral function, can be accessed through scanning tunnelling spectroscopy. Here we use scanning tunnelling microscopy and spectroscopy to visualize the local density of states and charge distribution in magic-angle twisted bilayer graphene. Doping the sample to partially fill the flat band, we observe a pseudogap phase accompanied by a global stripe charge order that breaks the rotational symmetry of the moiré superlattice. Both the pseudogap and the stripe charge order disappear when the band is either empty or full. The close resemblance to similar observations in high-temperature superconductors15,16,17,18,19,20,21 provides new evidence of a deeper link underlying the phenomenology of these systems.