powered by
Search best corner of plot for placing for legend
This function aims to find best corner for plotting a legend.
.bestLegendLoc( dat, txtLen, txtHi, displayPlotSearch = FALSE, silent = TRUE, debug = FALSE, callFrom = NULL )
numeric vector with counts of umber of points expected to enter legend-location for each corner (ie legend-localization)
(matrix, list or data.frame) main data of plot
(numeric, length=1)
(numeric, length=1) text height from graphics::strheight() (including inter-line)
(logical) decide if lines to mark area where data is searched for legend should be drawn
(logical) suppress messages
(logical) additonal messages for debugging
(character) allows easier tracking of messages produced
checkForLegLoc, legend
checkForLegLoc
legend
dat1 <- matrix(c(1:5,1,1:5,5), ncol=2) (legLoc <- .bestLegendLoc(dat1, txtLen=0.4, txtHi=28))
Run the code above in your browser using DataLab