Learn R Programming

astro (version 1.2)

label: Add A Label To A Plot

Description

Does exactly what it says on the tin.

Usage

label(pos = "topleft", lab = "label", txt = NULL, inset = 0.1, whitespace = 0.08, col = "black", bgcol = "white", bty = "n", bordercol = "black", lwd = 1, cex = 1, align = "center")

Arguments

pos
position of label (topleft, top, topright, ...)
lab
contents of the label
txt
see 'lab' (backwards compatibility)
inset
label box inset
whitespace
separation between text and box edge
col
colour
bgcol
background colour
bty
box type (b or n)
bordercol
border colour
lwd
line width of the border
cex
expansion factor
align
text align within box

See Also

The astronomy package: astro.

Examples

Run this code
par("mar"=c(5.1,4.1,2.1,2.1))
aplot(sin, xlim=c(0,2*pi), ylim=c(-1.1,1.1), bgcol="lightgoldenrodyellow")
abline(h=0, col="grey75")
label("top", txt="Sine Function", lwd=0, bgcol="grey25", col="white")
label("bottomleft", txt="astro:label (label)", cex=2, lwd=0, bgcol=NULL)

Run the code above in your browser using DataLab