The differentiation of basaltic magmas to form more silica- rich magma is a fundamental process in crustal magmatism. However, suites of volcanic rocks erupted from individual volcanic centres rarely exhibit a compositional continuum between basalt and rhyolite. Instead, some rock suites exhibit marked compositional gaps1. The origin of such gaps has been attributed to partial melting of the crust2, the immiscibility of different magma types3, crystallization of specific mineral phases4 and processes occurring within magma chambers1,5,6. Here we couple high pressure and temperature experiments on mantle-derived basalt from St Vincent Volcano, Lesser Antilles, with variable water contents, to thermal models of magma differentiation. We show that the compositional distribution of the derivative magma varies as a function of water and heat content of the magmatic system, which is, in turn, related to the flux and duration of magma input. Systems that have relatively low heat content are characterized by compositional gaps, whose extent varies systemically with the water in the parent basalt. Irrespective of water content, compositional gaps diminish with time. Our approach can be used to retrieve information from volcanic rocks on their magmatic heat and water content in the parent basalt and hence explore these parameters as functions of tectonic settings and age.