text.plot {mining}R Documentation

Make a plot of text labels

Description

Like text except it creates a new plot with limits chosen to make all labels visible.

Usage

text.plot.default(x,y,labels,xlab,ylab,xlim=NULL,ylim=NULL,
                  cex=par("cex"),adj=NULL,srt=0,axes=T,...)
text.plot.data.frame(data,labels=rownames(data),...)
text.plot.formula(formula,data=parent.frame(),...)

Arguments

x,y numeric vectors, same length
data a data frame with at least two columns
formula a formula specifying a response and predictor variable
labels character vector, same length as x
srt rotation angle as in text.
adj text justification as in text.

Details

The main job of text.plot is finding the right plot limits so that all labels are visible. It does this by computing the bounding box of each label (taking into account text rotation and justification) and solving a system of inequalities which ensure that each label fits entirely into the plot window.

Author(s)

Tom Minka

Examples

data(state)
x <- data.frame(state.x77)
text.plot(x$Frost, x$HS.Grad, rownames(x))
# same thing, using text.plot.formula
text.plot(HS.Grad ~ Frost, x)
# notice how the limits change
text.plot(HS.Grad ~ Frost, x, srt=45)
text.plot(HS.Grad ~ Frost, x, srt=90)

[Package Contents]