updated to also plot optical spectra