affine-map-methods: affine.map

affine.mapR Documentation

affine.map

Description

affinely maps 1D points in vector x from interval xlim to interval ylim, ie takes points that lie in interval xlim and mapping onto interval ylim using linear / affine map defined by: (x0,y0) = c(xlim(1), ylim(1)), (x1,y1) = c(xlim(2), ylim(2)) (using two point formula for line) useful for plotting.

if cap.max or cap.min == T then values outside of the range will be capped at min or max

Usage

affine.map(
  x,
  ylim = c(0, 1),
  xlim = c(min(x), max(x)),
  cap = F,
  cap.min = cap,
  cap.max = cap,
  clip = T,
  clip.min = clip,
  clip.max = clip
)

Author(s)

Marcin Imielinski


mskilab/gTrack documentation built on Aug. 17, 2024, 6:10 a.m.