arrows2 | R Documentation |
Draw filled arrows between pairs of points.
arrows2(
x0,
y0,
x1 = x0,
y1 = y0,
size = 1,
width = 0.1/cin,
curve = 1,
code = 2L,
col = par("fg"),
lty = par("lty"),
lwd = par("lwd"),
fill = col,
border = fill,
sadj = c(0, 0, 0, 0),
...
)
x0, y0 |
coordinates of points from which to draw |
x1, y1 |
coordinates of points to which to draw |
size, width |
size parameters for arrows |
curve |
a numeric value greater than 0 giving the curvature of the
arrows; default is |
code |
integer determining kind of arrows to be drawn; arrows
are drawn at |
col, lty, lwd |
color, line type, and line width of the segment |
fill, border |
fill and border color of arrow |
sadj |
optional vector of the form |
... |
additional graphical parameters passed to |
Original: Andreas Ruckstuhl, 19 May 1994; Cosmetic: Martin Machler, June 1998; Modifications: Robert Redd
arrows
; carrows
; https://github.com/cran/sfsmisc
plot.new()
plot.window(c(-pi, pi), c(-1,1), asp = 1)
curve(sin(x), -pi, pi, add = TRUE)
xx <- seq(-pi, pi, length.out = 5)
## arrows point to locations
arrows2(xx, sin(xx), xx + 0, sin(xx + 0))
## arrows "follow" along curve
arrows2(xx, sin(xx), xx + .1, sin(xx + .1), col = 5, border = 2)
arrows2(-3,-1,3,1, code = 3, border = 2, fill = 0)
arrows2(-2, -1, -2, 1, code = 1, fill = 4, col = 4)
arrows2(-1, -1, -1, 1, code = 2, fill = 2, size = .5, width = .5)
arrows2(0, -1, 0, 1, code = 3, curve = 1.5)
arrows2(1, -1, 1, 1, code = 3, curve = .5, width = .5, lwd = 10, col = 3)
arrows2(2, -1, 2, 1, code = 3, lwd = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.