arrows | R Documentation |
Creates an arrow pointing at a specified plot location. See arrows
for more details.
arrows(object, ...)
object |
gsplot object |
... |
Further graphical parameters may also be supplied as arguments. See 'Details'. |
Often used with text
to label a feature on the plot. Additional graphical parameter inputs:
x0, y0
position of the arrow tail
x, y
position of the arrow head
col, lty, lwd
parameters describing the color, type, and width of the arrow, respectively
legend.name
name that appears in the legend, see legend
for more legend parameters
arrows
gs <- gsplot() %>%
points( y=c(3,1,2), x=1:3, xlim=c(0,NA),ylim=c(0,NA),
col="blue", pch=18, legend.name="Points", xlab="Index") %>%
lines(c(3,4,3), c(2,4,6), legend.name="Lines", ylab="Data") %>%
abline(b=1, a=0, legend.name="1:1") %>%
legend(location="topleft",title="Awesome!") %>%
grid() %>%
error_bar(x=1:3, y=c(3,1,2), offset.up=c(0.5,0.25,1), offset.down=0.1) %>%
error_bar(x=1:3, y=c(3,1,2), offset.left=.2, offset.right=.2, col="red",lwd=3) %>%
arrows(x0=0.75, y0=2, x1=1, y1=2.8, lwd=2) %>%
title("Graphing Fun") %>%
text(.75,1.75,labels="Weird data")
gs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.