View source: R/textBoxPlacement.R
positionTextBox | R Documentation |
compute x and y coordinates for placement of text box based upon the values of the function to avoid running into the graph line
positionTextBox(text, x, y, xPos, adj, nApprox = 10, reallyText)
text |
character string text to insert in plot |
x |
numeric vector of x values |
y |
numeric vector of y values |
xPos |
numeric x position for text box |
adj |
numeric vector param passed to text() |
nApprox |
integer number of intervals to interpolate between x data points |
reallyText |
Boolean if TRUE then execute text() command |
returns a list c(ymin,ymax,strheight(text),xPos1)
x<-1:10
y<-1:10
plot(x,y,type="l")
positionTextBox(text="TEXT ME",x=x,y=y,xPos=1,
adj=c(0,0),nApprox=10,reallyText=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.