Large low-velocity seismic anomalies have been detected in the Earth's lower mantle beneath Africa and the Pacific Ocean that are not easily explained by temperature variations alone. The African anomaly has been interpreted to be a northwest-southeast-trending structure with a sharp-edged linear, ridge-like morphology. The Pacific anomaly, on the other hand, appears to be more rounded in shape. Mantle models with heterogeneous composition have related these structures to dense thermochemical piles or superplumes. It has not been shown, however, that such models can lead to thermochemical structures that satisfy the geometrical constraints, as inferred from seismological observations. Here we present numerical models of thermochemical convection in a three-dimensional spherical geometry using plate velocities inferred for the past 119 million years. We show that Earth's subduction history can lead to thermochemical structures similar in shape to the observed large, lower-mantle velocity anomalies. We find that subduction history tends to focus dense material into a ridge-like pile beneath Africa and a relatively more-rounded pile under the Pacific Ocean, consistent with seismic observations.