Analysis of the effect of pressure on optical spectra