positionTextBoxDriver {textBoxPlacement} | R Documentation |
positionTextBoxDriver
Description
Driver to compute x and y coordinates for placement of text box based upon the values of the function to avoid running into the graph line and avoid overlapping with other overlay curves
Usage
positionTextBoxDriver(
text,
x,
y,
xPos,
nApprox = 10,
xList,
yList,
stag = FALSE,
offset = 0,
verbose
)
Arguments
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 |
nApprox |
integer number of intervals to interpolate between x data points |
xList |
list whose components are numeric vectors of the x values for overlaid curves |
yList |
list whose components are numeric vectors of the y values for overlaid curves |
stag |
Boolean TRUE if this plot has staggering added to curves |
offset |
numeric vector of offsets added to each curve |
verbose |
Boolean if TRUE print informative or diagnostic messages to console |
Value
returns a numeric vector c(yReal,yAdj) where xTry is an x value at which the text box will fit without overlapping another overlay curve, or returns -1000000 for failure
Examples
positionTextBoxDriver(text="TEXT ME",x=xList1[[1]],y=yList1[[1]],
xPos=1,nApprox=10,xList=xList1[-1],yList=yList1[-1],stag=FALSE,offset=0,verbose=TRUE)