carrows | R Documentation |
Draw an arrow along the arc of a circle.
carrows(
p1,
p2,
arc,
degree = FALSE,
pad = 0.01 * 1:2,
flip = FALSE,
dir = NULL,
col = par("col"),
lwd = par("lwd"),
lty = par("lty"),
size = 1,
width = size/2,
curve = 1,
fill = col,
border = NA
)
p1, p2 |
vectors of length two giving the |
arc |
a vector of length two with the starting and ending positions to draw the arc, in radians or degrees |
degree |
logical; if |
pad |
a vector of length two giving 1) padding between the tips of the arrow/segment and the points and 2) additional padding between the segment endpoints and tip of arrow–useful for thick lines which may protrude from under the arrowhead |
flip |
logical; if |
dir |
optional vector of directions for arrows; by default, arrows
will point to the nearest endpoint; |
col, lwd, lty |
color, line width, and line type passed to
|
size, width, curve, fill, border |
additional parameters passed to
|
A list containing the arc endpoints and the center and radius of the corresponding circle.
arrows2
; xspline
plot.new()
plot.window(c(-2,2), c(-2,2))
p <- matrix(c(rep(-1:1, 2), rep(-1:1, each = 2)), ncol = 2)
points(p)
carrows(p1 <- p[2, ], p2 <- p[1, ], pad = 0.3)
carrows(p1 <- p[4, ], p2 <- p[5, ], dir = c(0, 1), col = 3)
carrows(p1 <- p[6, ], p2 <- p[3, ], lwd = 10, pad = c(0.05, 0.1))
carrows(p1 <- p[1, ], p2 <- p[6, ], flip = TRUE)
carrows(p1 <- p[1, ], p2 <- p[5, ], dir = c(1, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.