# There is not enough space for text boxes in original graph.
# The package automatically adds offsets to the curves,
# keeping the curves in the original order,
# and successfully adds text boxes
positionTextBoxDriverDriverDriver(xList=xList1,yList=yList1,
textList=textList,xPos=c(1,1,1),nApprox=10,labs=labs,sortB=FALSE)
# data set contains some negative values
positionTextBoxDriverDriverDriver(xList=xList2,yList=yList2,
textList=textList,xPos=c(1,1,1),nApprox=10,labs=labs,sortB=FALSE)
# show the difference when we sort the order of the curves
# to position the curve with the largest range on the bottom
positionTextBoxDriverDriverDriver(xList=xList2,yList=yList2,
textList=textList,xPos=c(1,1,1),nApprox=10,labs=labs,sortB=TRUE,verbose=TRUE)
Run the code above in your browser using DataLab