Draw a curved line with arrowhead.
cArrows(
x1,
y1,
x2,
y2,
code = 2,
size = 1,
width = 1.2/4/cin,
open = TRUE,
sh.adj = 0.1,
sh.lwd = 1,
sh.col = par("fg"),
sh.lty = 1,
h.col = sh.col,
h.col.bo = sh.col,
h.lwd = sh.lwd,
h.lty = sh.lty,
curved = FALSE,
beautiful.arrow = 2/3
)
A list wit lab.x and lab.y being the position where to draw label
coordinates of points from which to draw.
coordinates of points from which to draw.
coordinates of points to which to draw.
coordinates of points to which to draw.
integer code (1, 2, or 3), determining kind of arrows to be drawn.
size of the arrowhead.
width of the arrowhead.
shape of the arrowhead.
Shift the beginning of the line.
width of the line.
color of the line.
type of line.
color of the arrowhead.
color of the arrowhead border.
width of the arrowhead.
type of line for the arrowhead.
0 is a straigth line, positive of negative value make the line curved.
if open is false, make the arrowhead more beautiful.
Modified from iGraph
cArrows draws curved lines with arrowhead
plot(c(1, 10), c(1, 10), type="n", bty="n")
cArrows(x1=2, y1=2, x2=6, y2=6, curved=1)
cArrows(x1=2, y1=2, x2=6, y2=6, curved=0)
cArrows(x1=2, y1=2, x2=6, y2=6, curved=1, sh.adj=1)
cArrows(x1=2, y1=2, x2=6, y2=6, curved=-1, open=FALSE)
cArrows(x1=9, y1=2, x2=6, y2=6, curved=-1, open=FALSE, sh.col="red")
cArrows(x1=9, y1=9, x2=6, y2=6, curved=-1, open=FALSE, h.col="red")
cArrows(x1=2, y1=9, x2=6, y2=6, curved=1, open=FALSE, h.col="red", h.col.bo="red")
Run the code above in your browser using DataLab