Lapointe, Pierre
2005-May-25 19:48 UTC
[R] Plot: Distance between tick and tick label on y-axis
Hello, I want to reduce the distance between my ticks and their labels. I managed to do it for the x-axis, but the y-axis puzzles me. Here's an example where there is no space between the x-asix ticks and labels. par(las=1) plot(runif(50), type="l",xaxt="n",yaxt="n",ylab="", bty="l") axis(2) axis(1,padj=-1.5) #However, axis(2,padj=-1.5) #does not work I understand from ?axis that padj will take its direction from the par(las). In this case, padj will move labels up and down for both x-axis and y-axis. I want my y-axis labels to be horizontal. I can I reduce the distance between y-axis ticks and labels? Regards, Pierre Lapointe Assistant Market Strategist *********************************************************************************** AVIS DE NON-RESPONSABILITE:\ Ce document transmis par courri...{{dropped}}
Paul Murrell
2005-May-25 23:58 UTC
[R] Plot: Distance between tick and tick label on y-axis
Hi You might have more luck with par(mgp), for example, ... par(las=1) plot(runif(50), type="l",xaxt="n",yaxt="n",ylab="", bty="l") axis(2, mgp=c(3, .5, 0)) axis(1, mgp=c(3, .3, 0)) Paul Lapointe, Pierre wrote:> Hello, > > I want to reduce the distance between my ticks and their labels. I managed > to do it for the x-axis, but the y-axis puzzles me. Here's an example where > there is no space between the x-asix ticks and labels. > > par(las=1) > plot(runif(50), type="l",xaxt="n",yaxt="n",ylab="", bty="l") > axis(2) > axis(1,padj=-1.5) > > #However, > axis(2,padj=-1.5) #does not work > > I understand from ?axis that padj will take its direction from the par(las). > In this case, padj will move labels up and down for both x-axis and y-axis. > I want my y-axis labels to be horizontal. > > I can I reduce the distance between y-axis ticks and labels? > > > Regards, > > Pierre Lapointe > Assistant Market Strategist > > > > *********************************************************************************** > AVIS DE NON-RESPONSABILITE:\ Ce document transmis par courri...{{dropped}} > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/