All Spectra with manual colours

Plot all spectra from the hyperSpec object with manually set colours. Palette define by brewer.pal and colorRampPalette functions. Manual selection of palette is applied by scale_color_manual parameter.

nspectra<-nrow(object01)
pal01<-colorRampPalette(brewer.pal(nspectra, "Set1")) 
 
all01<-ggplot(object02, aes (x = .wavelength, y = spc, colour = Sample))+ geom_line (size =lsize1) +
  scale_x_reverse()+
  scale_color_manual(values = pal01(nspectra))+
  labs(x=expression(bold(paste ("Wavenumber", " [",cm ^-1, "]"))), y = "mIRage Amplitude [a.u.]" )
all01
Krzysztof Banas
Krzysztof Banas
Principal Research Fellow

I work as beam-line scientist at Singapore Synchrotron Light Source. My research interests include application of advanced statistical methods for hyperspectral data processing (dimension reduction, clustering and identification).

Related