plotNMR {mrbin} | R Documentation |
A function for plotting NMR spectra.
Description
This function plots the current NMR spectrum. If no parameters are provided, parameters are read from the mrbin.env environment variables, set by mrbin. To change the plot, use zoom(), zoomIn(), zoomOut(), intPlus(), intMin(), left(), right(). For 2D data use additionally: contMin(), contPlus(), up(), down()
Usage
plotNMR(
region = NULL,
rectangleRegions = NULL,
rectangleColors = c("darkseagreen3", "orange", "blue", "red", "yellow", "gray",
"purple"),
rectangleColors2D = NULL,
density = NULL,
angles = 35,
rectangleFront = FALSE,
polygonRegion = NULL,
color = NULL,
add = FALSE,
showGrid = FALSE,
manualScale = TRUE,
plotTitle = "",
title = NULL,
titleCounter = NULL,
hideNegative = FALSE,
restrictToRange = FALSE,
currentSpectrumOriginal = NULL,
spectrumTMP = NULL,
renewSpectrum = TRUE,
cex.axis = 0.7,
perspective = FALSE,
noise = NULL,
dimension = NULL,
plotDelay = 0.1,
lwd = 1,
background = NULL,
...
)
Arguments
region |
A vector defining the plot region (left, right, top, bottom) or "all" for the whole spectrum |
rectangleRegions |
A 4-column matrix defining areas where to plot rectangles |
rectangleColors |
Define colors for the rectangles |
rectangleColors2D |
Define colors for rectangles in 2D spectra. If NULL, defaults to the same as rectangleColors |
density |
Shading lines for the rectangles |
angles |
Angles of shading lines for the rectangles |
rectangleFront |
Plot rectangles in front of spectrum rather than in background (only 2D) |
polygonRegion |
Defines 4 corners of a polygon to be plotted |
color |
Defines the color of the spectrum plot. If NULL, a rainbow theme is used for 2D NMR |
add |
If TRUE, additional spectrum plots are overlaid with the current plot |
showGrid |
Shows a grid of data points. Defaults to FALSE |
manualScale |
If TRUE, scaling factor is taken from environment variables |
plotTitle |
Defines the main title of the plot |
title |
Display the spectrum title in plot, defaults to NULL |
titleCounter |
Count of the spectrum title for positioning in plot, defaults to NULL |
hideNegative |
Should negative parts of the 2D spectrum be hidden? Defaults to FALSE |
restrictToRange |
Restrict plot area to range of available data points. Defaults to FALSE |
currentSpectrumOriginal |
Optional spectral data. If omitted, data from the environment variables is used |
spectrumTMP |
A size-reduced spectrum for quicker plotting. Defaults to NULL |
renewSpectrum |
Should a new size-reduced spectrum for quicker plotting be calculated, or can the old one be used? Default: TRUE |
cex.axis |
Font size of axis tick labels. |
perspective |
If TRUE, a perspective plot will be displayed for 2D data instead of the regular topographic view |
noise |
If provided, a line or plane at this level will be added to the plot to indicate noise level |
dimension |
"1D' or "2D". If not provided, this will be deduced from the data |
plotDelay |
Add a small delay in seconds to force RStudio to update plots |
lwd |
Line width, defaults to 1 |
background |
Background color, defaults to NULL (no background fill, usually results in a white background) |
... |
Additional graphical parameters that will be passed to the functions plot, lines, and/or contour |
Value
An (invisible) dimension-reduced spectrum, either a matrix or a vector
Examples
resetEnv()#clean up previous data from the package environment
mrbin(silent=TRUE,setDefault=TRUE,parameters=list(dimension="1D",binwidth1D=.1,
PQNScaling="No",noiseRemoval="No",trimZeros="No",
fixNegatives="No",logTrafo="No",PCA="No",verbose=TRUE,NMRvendor="mrbin",
example=TRUE,#only used for the package examples
NMRfolders=system.file("extdata/1.mr1",package="mrbin")))
plotNMR()