Sex ratios are subject to strong frequency-dependent selection regulated by the mating system and the relative male versus female investment. In androdioecious plant populations, where males co-occur with hermaphrodites, the sex ratio depends on the rate of self-fertilization by hermaphrodites and on the relative pollen production of males versus hermaphrodites. Here, we report evolutionary changes in the sex ratio from experimental mating arrays of the androdioecious plant Mercurialis annua. We found that the progeny sex ratio depended strongly on density, with fewer males in the progeny of plants grown under low density. This occurred in part because of a plastic adjustment in pollen production by hermaphrodites, which produced more pollen when grown at low density than at high density. Our results provide support for the prediction that environmental conditions govern sex ratios through their effects on the relative fertility of unisexual versus hermaphrodite individuals.