arrows2: Add arrows to a plot

View source: R/arrows2.R

arrows2R Documentation

Add arrows to a plot

Description

Draw a custom arrows between pairs of points.

Usage

arrows2(
  x0,
  y0,
  x1 = x0,
  y1 = y0,
  off0 = 0,
  off1 = off0,
  cex.arr = 1,
  cex.shr = 1,
  cex.hh = 1,
  cex.hl = 1,
  prophead = TRUE,
  twoheaded = FALSE,
  ...
)

Arguments

x0

the x coordinates of points from which to draw arrows.

y0

the y coordinates of points from which to draw arrows.

x1

the x coordinates of points to which to draw arrows.

y1

the y coordinates of points to which to draw arrows.

off0

offset of points from which to draw arrows.

off1

offset of points to which to draw arrows.

cex.arr

the magnification coefficient to be used for the heights of the arrows.

cex.shr

the magnification coefficient to be used to change the height of arrows towards their heads.

cex.hh

the magnification coefficient to be used for the heights of arrows' head.

cex.hl

the magnification coefficient to be used for the lengths of arrows' head.

prophead

logical. If TRUE arrows are drawn with head proportional to the length of the arrows.

twoheaded

logical. If TRUE two-headed arrows are drawn, default is FALSE.

...

additional arguments to be passed to polygon function.

See Also

graphics::arrows()

Examples

# Example 1:
plot0(c(0, 10), c(0, 10))
arrows2(1, 9, 8)
arrows2(1, 8, 8, 1, cex.hh = 1.2, cex.hl = 1.2, col = "grey30", lwd = 1.2,
 prophead = TRUE, twoheaded = TRUE)
arrows2(5, 9, 5, 1)

# Example 2:
plot0(c(0, 1), c(0, 1))
arrows2(runif(2), runif(2), x1 = runif(2), y1 = runif(2))
arrows2(runif(2), runif(2), x1 = runif(2), y1 = runif(2), prophead = FALSE,
 lty = 3)


inSileco/graphicsutils documentation built on Sept. 12, 2022, 11:13 p.m.