Dear R experts: I have an odd question: would it be better to calculate the location of the axis label relative to the furthest protruding tick label? the background is that I have my y-tick labels oriented horizontally rather than vertically. if R chooses to set a tick mark at "2", the y label should be relatively close to the axis. if R chooses to put 1.998, it should sit farther (because otherwise the "1" may touch the y label). possible? regards, /ivo
Dear R-Wizards: does anyone know how to obtain the width of the widest y- or x-tick label that R has drawn, so that I can leave appropriate space between it and my overall axis text label appropriately? regards, /ivo welch
Duncan Murdoch
2006-Jun-28 17:55 UTC
[R] y-axis label location relative to tick label width?
On 6/28/2006 1:49 PM, ivo welch wrote:> Dear R-Wizards: does anyone know how to obtain the width of the > widest y- or x-tick label that R has drawn, so that I can leave > appropriate space between it and my overall axis text label > appropriately?Probably the easiest way is to draw them yourself. That is, draw the plot with axes=FALSE, then draw the axes using the axis() function, using pretty() to calculate the tick locations. Duncan Murdoch