utils_matrix_guide: Color Guide for Matrix Plot

View source: R/utils_matrix_guide.R

utils_matrix_guideR Documentation

Color Guide for Matrix Plot

Description

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

See Also

Other internal_plotting: color_continuous(), color_discrete(), utils_color_breaks(), utils_line_color(), utils_line_guide(), utils_matrix_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)
}

distantia documentation built on April 4, 2025, 5:42 a.m.