text_plot | R Documentation |
Like text
except it creates a new plot with
limits chosen to make all labels visible.
text_plot(object, ...)
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 |
srt |
rotation angle as in |
adj |
text justification as in |
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.
Tom Minka
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.