plot_corr2d: Plot two-dimensional correlation spectra.

View source: R/corr2d_plot.R

plot_corr2dR Documentation

Plot two-dimensional correlation spectra.


plot_corr2d plots two-dimensional correlation spectra either as an image or a contour plot. Red color indicates positive correlations, while blue color shows negative ones.


  what = Re(Obj$FT),
  specx = Obj$Ref1,
  specy = Obj$Ref2,
  xlim = NULL,
  ylim = NULL,
  xlab = expression(nu[1]),
  ylab = expression(nu[2]),
  Contour = TRUE,
  axes = 3,
  Legend = TRUE,
  N = 20,
  zlim = NULL,
  Cutout = NULL,
  col = par("col"),
  lwd = par("lwd"),
  lwd.axis = NULL,
  lwd.spec = NULL,
  cex.leg = NULL,
  at.xaxs = NULL,
  label.xaxs = TRUE,
  at.yaxs = NULL,
  label.yaxs = TRUE,
  line.xlab = 3.5,
  line.ylab = 3.5,



List from corr2d containing the 2D correlation data.


Real numeric matrix containing the z-values that should be plotted.

specx, specy

Numeric vector containing the data that should be plotted on top (specx) and/or on the left (specy) of the 2D spectrum. Mat, specx and/or specy should have the same dimensions, respectively. If NULL nothing will be plotted.

xlim, ylim

Numeric vector with two values indicating the borders of the 2D plot. Also truncates specx and/or specy to match the new plot range.

xlab, ylab

Character or expression containing the text that will be plotted on the bottom (xlab) and/or to the right (ylab) of the 2D plot. Labels can be suppressed with NA.


Logical: Should a contour (TRUE) or image (FALSE) be drawn?


Integer ranging from 0 to 3. Should the axis of the 2D plot be drawn? "0" means no axes, "1" only bottom axis, "2" only right axis and "3" both axes are drawn.


Logical: Should a color legend be plotted in the top right corner?


Positive, non-zero integer indicating how many contour or image levels should be plotted.


Numeric vector with two values defining the z-range of the 2D plot.


Numeric vector with two values defining which z-values should not be plotted. Use with care, because this can generate misleading 2D plots.


A specification for the plotting color of the reference spectra (top and left), axes, axes ticks and the central plot surrounding box. See par and contour for additional information.


A numeric value which sets the line width in the contour plot. See par and contour for additional information.


A numeric value which sets the line width for axes and the central plot surrounding box. See par and axis for additional information.


A numeric value which sets the line width in the reference spectra on top and to the left. See par and plot.default for additional information.


A numerical value giving the amount by which numbers at the legend should be magnified. See par and image.plot for additional information.

at.xaxs, at.yaxs

The points at which tick-marks are to be drawn at the x- and y-axis, respectively. See axis for additional information.

label.xaxs, label.yaxs

This can either be a logical value specifying whether (numerical) annotations are to be made at the tickmarks of the x- and y-axis, or a character or expression vector of labels to be placed at the tickpoints of the x- and y-axis. See axis for additional information.

line.xlab, line.ylab

Numeric value on which MARgin line the x- and y-label is plotted, respectively, starting at 0 counting outwards. See mtext for additional information.


Additional arguments either passed to image or contour. Can include graphics parameters par which are in part also used by other functions. This includes cex.axis (influences axes and their label magnification), cex.lab (influences label magnification), col.axis (influences axes label color), col.lab (influences label color), font.axis (influences axes label font), font.lab (influences label font) and lty (influences line type for contour plot).


For the synchronous correlation spectrum the real component (Re) of the complex correlation matrix must be plotted. The asynchronous spectrum is the respective imaginary component (Im). Cutout can be used to leave out smaller (noise) contributions, but should be used with care as it can be used to create misleading 2D correlation plots. See references for interpretation rules (so called Noda rules).


For interpretation rules see: I. Noda (2006) <DOI:10.1016/j.molstruc.2005.12.060>
R. Geitner et al. (2019) <DOI:10.18637/jss.v090.i03>

See Also

See plot_corr2din3d for 3D plots.


    data(FuranMale, package = "corr2D")
    twod <- corr2d(FuranMale, Ref1 = FuranMale[1, ], corenumber = 1)
    plot_corr2d(twod, xlab = expression(paste("relative Wavenumber" / cm^-1)),
                      ylab = expression(paste("relative Wavenumber" / cm^-1)))
    plot_corr2d(twod, at.xaxs = c(1560, 1585, 1610),
                label.xaxs = c(1560, 1585, 1610),
                col = 2, lwd = 3, col.axis = 3, col.lab = 4, Legend = FALSE,
                cex.lab = 3, xlab = "Large x label", ylab = "Large y label",
                line.xlab = 5, line.ylab = 5)

corr2D documentation built on July 14, 2022, 5:06 p.m.