# Re: [R] Position of Axis Labels (Base Graphics)

From: Uwe Ligges <ligges_at_statistik.tu-dortmund.de>
Date: Thu, 10 Jun 2010 11:06:33 +0200

On 10.06.2010 11:02, Singmann wrote:
>
> Hi,
>
> I wonder if there is a way to selectively manipulate the position of the
> axis labels (i.e., the numbers). As far as I get it from ?par the only way
> to manipulate it is via mgp = c(x,y,z), where z is the relevant number.
> However, this manipulates the position of the axis labels for both the x-
> and y-axis.
>
> The reason I want to do this is that I have the impression that when using
> the standard values, the x-axis labels are somewhat further from the axis
> ticks than the y-axis labels. To make both more similar I would like to
> position the x-axis labels a little bit nearer to the axis.
>
> I know I can work around this problem by suppressing one axis (yaxt="n") and
> then adding it afterwards via axis(side=2,...). But I wonder if one cannot
> do this in a better way (hey, it is R).
>

Right, and axis() is the way to go.

Uwe Ligges

> Here is a plot where you should see the problem with the different distance
> of the labels from the axis ticks:
>
> plot(50,50,xlab="", ylab="", xlim=c(30,100), ylim=c(30,100), cex.axis=0.8)
>
> Thanks,
>
> Henrik Singmann

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 10 Jun 2010 - 09:09:47 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Jun 2010 - 09:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.