panel.arrowbox: Panel function to draw box-like arrows

View source: R/panel_arrowbox.R

panel.arrowboxR Documentation

Panel function to draw box-like arrows

Description

Panel function to draw boxes with arrow head from 2 XY coordinates and direction argument. Each argument can be a vector of same length so that multiple arrows can be drawn at once. Is internally used in 'panel.geneplot'.

Usage

panel.arrowbox(x0, x1, y0, y1, direction = NULL, tip = NULL, ...)

Arguments

x0, x1, y0, y1

(numeric) coordinates of the two points determining the rectangle (bottom left, top right).

direction

(numeric) direction in which arrow should point, 1 for right, -1 for left side

tip

(numeric) pointedness of the arrow head (in native X units. Defaults to a 30th of x scale)

...

other arguments passed to the function

Examples

library(lattice)

xyplot(1:3 ~ 4:6, col = "#0080ff",
  panel = function(x, y, ...) {
    panel.arrowbox(x0 = c(4, 5), y0 = c(2.5, 1),
      x1 = c(5, 6), y1 = c(3, 1.5),
      direction = c(1, -1), ...)
  }
)


m-jahn/lattice-tools documentation built on Dec. 3, 2023, 11:14 p.m.