Learn R Programming

plotrix (version 2.1-5)

textbox: Add text box

Description

Add text to plot, justified, in a box

Usage

textbox(x,y,textlist,justify=TRUE,cex=1,leading=0.5,box=TRUE)

Arguments

x
x position: a vector with min. and max. x position
y
y position: location of the top of the box
textlist
a vector of text strings
justify
justify text in box?
cex
character size
leading
inter-line spacing
box
draw a box around the text?

Value

  • nil

Details

Justifies text in the box by pasting the vector together, splitting it into words, and then adding words to the current line until the line is wide enough

Examples

Run this code
plot.new()
 textbox(c(0,0.2),1,c("many words","more words","why not?",
                      "keep going",rep("and going",10)))

Run the code above in your browser using DataLab