abline | R Documentation |
Creates straight lines on the existing gsplot object. See abline
for more details.
abline(object, ...)
object |
gsplot object |
... |
Further graphical parameters may also be supplied as arguments. See 'Details'. |
Additional graphical parameter inputs:
a, b
slope, y-intercept
h
the y-value specifying a horizontal line
v
the x-value specifying a vertical line
col, lty, lwd
parameters describing the color, type, and width of the line, respectively
legend.name
name that appears in the legend, see legend
for more legend parameters
abline
gs <- gsplot()
gsNew <- points(gs, y=1, x=2, col="blue", pch=18, legend.name="Points")
gsNew <- lines(gsNew, c(3,4,3), c(2,4,6), legend.name="Lines")
gsNew <- abline(gsNew, b=1, a=0, legend.name="1:1")
gsNew <- legend(gsNew, location="topleft",title="Awesome!")
gsNew
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.