Arrows | R Documentation |
Draws a set of open or closed arrows which can be shaped by
many arguments. Arrows
is an extended version of
p.arrows
.
Arrows(x1, y1, x2, y2, 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,
verbose = FALSE)
x1 , y1 |
Coordinates of points from which to draw. |
x2 , y2 |
Coordinates of points to which to draw. |
size |
Head size as a fraction of a character height. |
width |
Width of the arrow head. See argument |
open |
Defines if arrows are open or closed. |
sh.adj |
Defines gap between end of the shaft and the top of the head of the arrow (see details) |
sh.lwd |
Thickness of shaft. cf. |
sh.col |
Color of shaft. cf. |
sh.lty |
Line type of shaft. cf. |
h.col |
Color of head. |
h.col.bo |
Color of border of head. |
h.lwd |
Line width of border of head. |
h.lty |
Line type of border of head. |
verbose |
When TRUE, the width used is returned. |
Definition of sh.adj:
End of shaft at top of head,
End of shaft at bottom of head,
Gap between shaft and head,
Head is on the shaft.
This function is based on graphics
A value is only returned, when verbose == TRUE
.
The plotting device should not be resized manually after plotting as this changes in general the aspect ratio of the plot and deforms hereby the plotted arrows. The beauty of the arrows depends from the resolution of the device. The higher resolutions give better results.
Andreas Ruckstuhl, refined by Rene Locher
p.arrows
, arrows
## a bunch of different arrows
plot(c(0,10), c(0,10), type="n")
Arrows(5, 5, 5,10, size=3,
sh.lwd=5, sh.lty=2,
h.lwd=5)
Arrows(5, 5, 7.5, 9, size=3, open=TRUE,
sh.adj=0.7, sh.lwd=5, sh.lty=2,
h.col.bo="red",h.lwd=5)
Arrows(5, 5, 9, 7.5, size=3, open=FALSE,
sh.adj=1, sh.lwd=5, sh.col="blue",
h.col.bo="red",h.lwd=2)
Arrows(5, 5, 10, 5, size=2.5, width=1.5, open=FALSE,
sh.adj=1, sh.lwd=7, sh.col="blue")
Arrows(5, 5, 9, 2.5, size=4, open=FALSE,
sh.lty=0,
h.col.bo="black",h.lwd=5)
Arrows(5, 5, 7.5, 1)
Arrows(5, 5, 5, 0, size=2)
Arrows(5, 5, 2.5, 1, size=2, width=1)
## vector field
x<- runif( 20)
y<- runif( 20)
u<- 0.1+0.02*rnorm(20)
v<- 0.1+0.02*rnorm(20)
plot(x,y,xlim=range(c(x,x+u)),ylim=range(c(y,y+v)),type="n")
Arrows(x,y,x+u,y+v,sh.col="blue")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.