Fix bug in utils.plot_spectra