Plot a set of deconvoluted spectra.
Arguments
- x
An object of type
decons0,decons1ordecons2. For details see metabodeconplus-classes.- foc_rgn
Numeric vector of length 2 specifying the focus region in ppm (e.g.
c(3.55, 3.35)). If NULL (default), the full spectrum is shown.- what
Which signal to plot:
"supal"(aligned superposition, default with fallback to"sup"then"si"),"sup"(superposition) or"si"(raw).- sfy
Scaling factor for the y-axis.
- cols
Character vector of colors, one per spectrum. Defaults to
rainbow(n).- lty
Line type(s), one per spectrum. Recycled if shorter than
n. Defaults to1(solid) for all spectra.- names
Character vector of legend labels. Defaults to spectrum names.
- xlab
Label for the x-axis.
- ylab
Label for the y-axis.
- mar
A numeric vector of length 4, which specifies the margins of the plot.
- lgd
Logical or list. If TRUE, a legend is drawn at "topright" with
cex = 0.8. If a list, its elements are passed tographics::legend()to override position, size, etc. Passlgd = FALSEto hide.- main
Optional plot title. Drawn via
graphics::title().- xaxt, yaxt
Character.
"s"(default) draws the axis normally;"n"suppresses axis ticks and tick labels. Passed tographics::plot().
See also
plot_spectrum() for a much more sophisticated plotting routine
suitable for plotting a single spectrum.
Examples
x <- deconvolute(sim[1:4], sfr = c(3.55, 3.35))
#> 2026-08-09 09:53:20.45 Starting deconvolution (spectra: 4, workers: 1)
#> 2026-08-09 09:53:20.45 Starting deconvolution of sim_01 using R backend
#> 2026-08-09 09:53:20.45 Starting peak selection
#> 2026-08-09 09:53:20.45 Detected 312 peaks
#> 2026-08-09 09:53:20.45 Removing peaks with low scores
#> 2026-08-09 09:53:20.46 Removed 285 peaks
#> 2026-08-09 09:53:20.46 Fitting Lorentz curves (3 iterations)
#> 2026-08-09 09:53:20.46 Finished deconvolution of sim_01
#> 2026-08-09 09:53:20.46 Starting deconvolution of sim_02 using R backend
#> 2026-08-09 09:53:20.46 Starting peak selection
#> 2026-08-09 09:53:20.46 Detected 316 peaks
#> 2026-08-09 09:53:20.46 Removing peaks with low scores
#> 2026-08-09 09:53:20.46 Removed 286 peaks
#> 2026-08-09 09:53:20.46 Fitting Lorentz curves (3 iterations)
#> 2026-08-09 09:53:20.46 Finished deconvolution of sim_02
#> 2026-08-09 09:53:20.46 Starting deconvolution of sim_03 using R backend
#> 2026-08-09 09:53:20.46 Starting peak selection
#> 2026-08-09 09:53:20.46 Detected 333 peaks
#> 2026-08-09 09:53:20.46 Removing peaks with low scores
#> 2026-08-09 09:53:20.46 Removed 308 peaks
#> 2026-08-09 09:53:20.46 Fitting Lorentz curves (3 iterations)
#> 2026-08-09 09:53:20.46 Finished deconvolution of sim_03
#> 2026-08-09 09:53:20.46 Starting deconvolution of sim_04 using R backend
#> 2026-08-09 09:53:20.46 Starting peak selection
#> 2026-08-09 09:53:20.46 Detected 324 peaks
#> 2026-08-09 09:53:20.46 Removing peaks with low scores
#> 2026-08-09 09:53:20.47 Removed 298 peaks
#> 2026-08-09 09:53:20.47 Fitting Lorentz curves (3 iterations)
#> 2026-08-09 09:53:20.47 Finished deconvolution of sim_04
#> 2026-08-09 09:53:20.47 Finished deconvolution 0.014 secs
plot_spectra(x)