Skip to contents

Plots a color legend for a distance or cost matrix for multi-panel plots or external image editors.

Usage

utils_matrix_guide(
  m = NULL,
  matrix_color = NULL,
  breaks = NULL,
  title = NULL,
  text_cex = 1
)

Arguments

m

(required, numeric matrix) distance or cost matrix generated by psi_distance_matrix() or psi_cost_matrix(), but any numeric matrix will work. Default: NULL

matrix_color

(optional, character vector) vector of colors. Default: NULL

breaks

(optional, numeric vector) vector of breaks for the color guide. Default: NULL

title

(optional, character string) guide title. Default: NULL

text_cex

(optional, numeric) multiplier for the text size. Default: 1

Value

Plot

Examples

#prepare time series list
tsl <- tsl_simulate(
  n = 2,
  independent = TRUE
)

#distance matrix between time series
dm <- psi_distance_matrix(
  x = tsl[[1]],
  y = tsl[[2]]
)

if(interactive()){
  utils_matrix_guide(m = dm)
}