View source: R/panel_arrowbox.R
panel.arrowbox | R Documentation |
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'.
panel.arrowbox(x0, x1, y0, y1, direction = NULL, tip = NULL, ...)
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 |
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), ...)
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.