[R] Force printing of excluded axis annotations

Jim Lemon jim at bitwrit.com.au
Thu Feb 9 11:25:40 CET 2012


Justin Fincher wrote:
 > Howdy,
 >     This should be simple, but I am finding that I can't find a simple
 > solution.  I have a plot to which I am manually adding the annotations
 > to the y-axis with this command:
 >
 > axis(2, 
c(-4,-3,-2,-1,0,1,2,3,4,5,6,7),labels=c(-4,-3,-2,-1,0,1,2,3,4,5,6,7),cex.axis=8)
 >
 > The issue is that, apparently, R doesn't think that the -1 can fit,
 > even though there is most certainly enough space.  Is there a way to
 > force R to print all the annotations I give it, regardless of
 > proximity or to reduce the space it believes it needs? Thank you.
 > - Fincher

Hi Justin,
The staxlab function (plotrix) will squeeze labels, just set nlines=1.

Jim



More information about the R-help mailing list