| pos2adj | R Documentation |
Convert a “directional” (e.g., ‘NE’, ‘S’, etc.) position to “adj” values for labeling a point.
pos2adj(
pos = c("center", "S", "W", "N", "East", "SW", "NW", "NE", "SE", "s", "w", "n", "east",
"sw", "nw", "ne", "se"),
offset = 0.5
)
pos |
A string that indicates a direction to place the label relative to a set of coordinates. |
offset |
A value that controls how far the label will be from the point (0=label starts on point). |
A vector of length two that contains the x- and y-coordinate adjustment values such that a label will be placed according to the “directional” position. The results from this function would be set equal to the adj= argument in text().
Derek H. Ogle, dogle@northland.edu
text.
## Make a dummy plot
plot(c(0.75,2,3.25),c(2,2,2),xlim=c(0,4),ylim=c(1,3),pch=16,xlab="x",ylab="y")
## Add some labels
text(2,2,"center",adj=pos2adj())
text(0.75,2,"north",adj=pos2adj("N"))
text(0.75,2,"south",adj=pos2adj("S"))
text(0.75,2,"east",adj=pos2adj("E"))
text(0.75,2,"west",adj=pos2adj("W"))
text(3.25,2,"NE",adj=pos2adj("NE"))
text(3.25,2,"NW",adj=pos2adj("NW"))
text(3.25,2,"SE",adj=pos2adj("SE"))
text(3.25,2,"SW",adj=pos2adj("SW"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.