plot.nmr2dinsitu.data.object: Plot In situ NMR data

Description Usage Arguments Details Value Examples

View source: R/PLOT-nmr2dinsitu.data.object.R

Description

This function plots in situ NMR data.

Usage

1
2
3
4
## S3 method for class 'nmr2dinsitu.data.object'
plot(nmr, use.default.layout = TRUE,
  separation = 0.1, separation.pos = c(4, 2), nmr.func = NULL,
  echem.func = NULL, ...)

Arguments

nmr

In situ nmr data

use.default.layout

If TRUE, a side-by-side 3:1 layout will be used for NMR-Echem. If FALSE, layout must be called prior to calling plot Plot #1 will be used for NMR, #2 for echem

separation

Gap between plots (in inches)

separation.pos

Where to put the separation – vector c(nmr, echem) where nmr,echem are one of 1=bottom, 2=left, 3=top, 4=right

nmr.func

Function to plot NMR data (default plot.nmr2d.data.object)

echem.func

Function to plot echem data (default plot_echem_vertical)

...

Further parameters will be passed to the plotting methods

Details

The echem function will always be passed the echem data restricted to the NMR scans plotted as its first argument, and a ylim parameter which will align its data as another argument. Any further named arguments provided via ... are passed through.

The NMR function will always be passed the NMR data as its first argument. Any further named arguments provided via ... are passed through. It is expected to return a numeric vector of the y values corresponding to an intensity of 0 for the first and last scans.

Value

Returns a function that will change the active plot to the NMR plot without disrupting the current layout (the echem plot is active by default when the plot function returns).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot(data)

set_nmr <- plot(data)

# Add some annotations to the echem plot
time <- c(1, 2)
V <- Plotting.Utils::nearest(echem, Test_Time.s.=time * 3600)$Voltage.V
points(V, time, col=c("red", "blue"))

# Activate the nmr plot
set_nmr()
# Add annotations to the NMR plot
points(0, 10000, col="green")

jmstrat/NMR.Utils documentation built on July 14, 2019, 11:35 p.m.