# ABCCoords: Coordinates for "bottomright", etc. In AndriSignorell/DescTools: Tools for Descriptive Statistics

 ABCCoords R Documentation

## Coordinates for "bottomright", etc.

### Description

Return the xy.coordinates for the literal positions "bottomright", etc. as used to place legends.

### Usage

``````ABCCoords(x = "topleft", region = "figure", cex = NULL, linset = 0, ...)
``````

### Arguments

 `x` one out of `"bottomright"`, `"bottom"`, `"bottomleft"`, `"left"`, `"topleft"`, `"top"`, `"topright"`, `"right"`, `"center"` `region` one out of `plot` or `figure` `cex` the character extension for the text. `linset` line inset in lines of text. `...` the dots are passed to the `strwidth()` and `strheight()` functions in case there where more specific text formats.

### Details

The same logic as for the legend can be useful for placing texts, too. This function returns the coordinates for the text, which can be used in the specific text functions.

nothing returned

### Author(s)

Andri Signorell <andri@signorell.net>

`text`, `BoxedText`

### Examples

``````plot(x = rnorm(10), type="n", xlab="", ylab="")
# note that plot.new() has to be called before we can grab the geometry
ABCCoords("bottomleft")

lapply(c("bottomleft", "left"), ABCCoords)

plot(x = rnorm(10), type="n", xlab="", ylab="")
text(x=(xy <- ABCCoords("bottomleft", region = "plot"))\$xy,

text(x=(xy <- ABCCoords("topleft", region = "figure"))\$xy,

plot(x = rnorm(10), type="n", xlab="", ylab="")
sapply(c("topleft", "top", "topright", "left", "center",
"right", "bottomleft", "bottom", "bottomright"),
function(x)
text(x=(xy <- ABCCoords(x, region = "plot", linset=1))\$xy,
)

plot(x = rnorm(100), type="n", xlab="", ylab="",
panel.first={Bg(c("red", "lightyellow"))
grid()})
xy <- ABCCoords("topleft", region = "plot")
par(xpd=NA)