getMarginWidth {plotrix} | R Documentation |
Calculates the margin width necessary to fit text or a legend next to a plot.
getMarginWidth(side=4,labels,is.legend=FALSE)
side |
Which side of the plot (as in axis). |
labels |
The text to place next to the plot. |
is.legend |
Whether the text is in a legend or not. |
getMarginWidth reads parameters about the current plot and calculates the left or right (default) margin necessary to fit the strings passed as labels or a legend containing those strings.
A two element list containing the number of margin lines necessary to fit the text or legend and the horizontal center of the margin in user units.
Jim Lemon
plot(rnorm(10)) getMarginWidth(labels=c("Long label","Even longer label"))