| label.ellipse {heplots} | R Documentation |
Draws a label on an ellipse (or similar closed ploygon object)
allowing a label.pos argument to specify the position of
the label as center, bottom, left, top, or right relative to the
object.
label.ellipse(ellipse, label, col = "black", label.pos = NULL,
xpd = TRUE, tweak = 0.5 * c(strwidth("M"), strheight("M")), ...)
ellipse |
A two-column matrix, or an object that can be coerced to one. |
label |
Label text, a character string, or expression (or coercible to such a type). |
col |
Label color |
label.pos |
Label position, an integer (in |
xpd |
logical. Whether to allow the label to go beyond the plot area. |
tweak |
A two element vector specifying minor adjustments applied to the
x or y coordinate of the label, depending on Alternatively, you can set |
... |
Other arguments passed to |
Like text, this function simply adds to an
existing base graphics plot.
None.
Michael Friendly
text, par
for other graphics parameters
op <- par(mfrow=c(1,2)) plot(c(-2,2), c(-3,3), type="n", xlab="x", ylab="y") E <- ellipse(c(0,0), matrix(c(1,2,2,5), 2, 2), 1, add=TRUE) label.ellipse(E, "default", col="red", cex=2) label.ellipse(E, "center", label.pos=0) label.ellipse(E, "bottom", label.pos=1) label.ellipse(E, "top", label.pos=3) label.ellipse(E, "left", label.pos=2) label.ellipse(E, "right", label.pos=4) plot(c(-2,2), c(-3,3), type="n", xlab="x", ylab="y") E <- ellipse(c(0,0), matrix(c(1,-2,-2,5), 2, 2), 1, add=TRUE) label.ellipse(E, "default", col="red", cex=2) label.ellipse(E, "center", label.pos="center") label.ellipse(E, "bottom", label.pos=1, cex=1.5) label.ellipse(E, "top", label.pos=3, cex=1.5) label.ellipse(E, "left", label.pos=2, cex=1.5) label.ellipse(E, "right", label.pos=4, cex=1.5) par(op)