Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotSpecMat

plotSpecMat Overlaid/Stacked Plot


Description

plotSpecMat Plot spectra set, overlaid or stacked; if stacked, plot with or without a perspective effect.

Usage

plotSpecMat(specMat, ppm_lim = c(min(specMat$ppm), max(specMat$ppm)),
  K = 0.67, pY = 1, dppm_max = 0.2 * (max(ppm_lim) - min(ppm_lim)),
  asym = 1, beta = 0, cols = NULL)

Arguments

specMat

a 'specMat' object - Spectra matrix in specMat$int (rows = samples, columns = buckets)

ppm_lim

ppm range of the plot

K

Graphical height of the stack (0 .. 1),(default=0.67)

pY

Intensity limit factor (default 1)

dppm_max

Max ppm shift to have a perspective effect

asym

Correction of vertical parallax effect (-1 .. 1) -1 : parallelogram 0 : trapeze with maximum asymmetric 1 : symmetric trapeze

beta

Correction of horizontal parallax effect (0 .. 0.2) (defaut 0)

cols

Vector of colors (same size that the number of spectra, i.e dim(specmat)[1])

Examples

data_dir <- system.file("extra", package = "Rnmr1D")
  cmdfile <- file.path(data_dir, "NP_macro_cmd.txt")
  samplefile <- file.path(data_dir, "Samples.txt")
  out <- Rnmr1D::doProcessing(data_dir, cmdfile=cmdfile, 
                                samplefile=samplefile, ncpu=detectCores())
  # Overlaid plot
  plotSpecMat(out$specMat, ppm_lim=c(0.5,9), K=0, pY=0.1)
  # Stacked plot with perspective effect
  plotSpecMat(out$specMat, ppm_lim=c(-0.1,9),K=0.33)
  # Stacked plot with perspective effect with maximum asymmetric
  plotSpecMat(out$specMat, ppm_lim=c(0.5,5), K=0.33, asym=0)
  cols <- c(rep("red",3), rep("blue",3))
  # Stacked plot with colors accordings to group levels
  plotSpecMat(out$specMat, ppm_lim=c(0.5,5), K=0.67, dppm_max=0, cols=cols)

Rnmr1D

Perform the Complete Processing of a Set of Proton Nuclear Magnetic Resonance Spectra

v1.2.5
GPL (>= 2)
Authors
Daniel Jacob [cre, aut] (<https://orcid.org/0000-0002-6687-7169>), Catherine Deborde [ctb], Marie Lefebvre [ctb]
Initial release
2019-11-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.