Plot (thresholded) distance matrix as a recurrence plot

rp_plot(
  RM,
  plotDimensions = FALSE,
  plotDimensionLegend = FALSE,
  plotMeasures = FALSE,
  plotRadiusRRbar = TRUE,
  drawGrid = FALSE,
  drawDiagonal = TRUE,
  diagColour = "grey50",
  drawNA = FALSE,
  markEpochsLOI = NULL,
  radiusValue = NA,
  courseGrain = TRUE,
  maxSize = 1000^2,
  title = "",
  xlabel = "",
  ylabel = "",
  plotSurrogate = NA,
  returnOnlyObject = FALSE
)

Arguments

RM

A distance matrix or recurrence matrix, preferably generated by function rp or rn.

plotDimensions

Should the state vectors be plotted if they are available as attributes of RM (default = TRUE)

plotDimensionLegend

If plotDimensions = TRUE plot a simple legend (default = FALSE)

plotMeasures

Print common (C)RQA measures in the plot if the matrix is binary (default = FALSE)

plotRadiusRRbar

The Radius-RR-bar is a colour-bar guide plotted with an unthresholded distance matrix indicating a number of RR values one would get if a certain distance threshold were chosen (default = TRUE)

drawGrid

Draw a grid on the recurrence plot (default = FALSE)

drawDiagonal

One usually omits the main diagonal, the Line Of Incidence (LOI) from the calculation of Auto-RQA measures., it is however common to plot it. Set to FALSE to omit the LOI from an Auto-Recurrence Plot (default = TRUE)

diagColour

Colour of the main diagonal (default = "grey50")

drawNA

Draw NA values in the recurrence plot? If FALSE then NA values will be considered non-recurring (default = FALSE)

markEpochsLOI

Pass a factor whose levels indicate different epochs or phases in the time series and use the line of identity to represent the levels by different colours (default = NULL)

radiusValue

If plotMeasures = TRUE and RM is an unthresholded matrix, this value will be used to calculate recurrence measures. If plotMeasures = TRUE and RM is already a binary recurrence matrix, pass the radius that was used as a threshold to create the matrix for display purposes. If plotMeasures = TRUE and radiusValue = NA, function est_radius() will be called with default settings (find a radius that yields .05 recurrence rate). If plotMeasures = FALSE this setting will be ignored.

courseGrain

Reduce the size of the matrix before plotting (greatly improves speed). If plotMeasures = TRUE coursegraining takes place after calculation of the CRQA measures. See mat_coursegrain() for details (default = TRUE)

maxSize

The maximum size of the matrix (cols x rows) above which the coursegraining function mat_coursegrain will be implemented if courseGrain = TRUE. This will speed up the plotting process

title

A title for the plot

xlabel

An x-axis label

ylabel

An y-axis label

plotSurrogate

Should a 2-panel comparison plot based on surrogate time series be added? If RM has attributes y1 and y2 containing the time series data (i.e. it was created by a call to rp), the following options are available: "RS" (random shuffle), "RP" (randomised phases), "AAFT" (amplitude adjusted fourier transform). If no timeseries data is included, the columns will be shuffled. NOTE: This is not a surrogate test, just 1 surrogate is created from y1. (default = FALSE)

returnOnlyObject

Return the ggplot object only, do not draw the plot (default = TRUE)

Value

A nice plot of the recurrence matrix.

See also

Other Distance matrix operations (recurrence plot): bandReplace(), createCorridor(), mat_di2bi(), mat_di2ch(), mat_di2we(), mat_hamming(), rp(), rp_lineDist(), rp_nzdiags(), rp_size()