Environmental stress and the distribution of traits within populations