View source: R/addAnnotation.R
addAnnotation | R Documentation |
Adds text to a plot to annotate a feature.
addAnnotation(x, y, annotation, leaderx = NULL, leadery = NULL, leadercol = "black", angle = 0, justification = "left", size = 60 * par("csi"), position = "above", current = list(yaxis.log = FALSE, yaxis.rev = FALSE, xaxis.log = FALSE))
x |
the x-axis placement of |
y |
the y-axis placement of |
annotation |
the text. Can be either a character string or an "expression" object. |
leaderx |
draw leader from |
leadery |
draw leader from |
leadercol |
the color of the leader. |
angle |
the angle to rotate the text. |
justification |
the justification of the text relative to |
size |
size of the text in points, the default is the current point size. |
position |
the vertical location of the text. Must be one of "above," "below," or "center." |
current |
the current plot controls. Typically, this would be the
output from one of the graph creation functions like |
This function places only a single annotation string on the graph for
each call.
A leader from x
, y
to leaderx
,
leadery
if leaderx
is not NULL
.
The current plot information is returned invisibly.
labelPoints
, addTable
,
xyPlot
## Not run: set.seed(12) X <- rnorm(12) Y <- X + rnorm(12) # make an outlier X[1L] <- 1.5 setGD() AA.pl <- xyPlot(X, Y) # label the outlier addAnnotation(X[1L], Y[1L], "Outlier", current=AA.pl) # For more details of addAnnotation see vignette(topic="GraphAdditions", package="smwrGraphs") demo(topic="TopAxisExample", package="smwrGraphs") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.