Re: [R] Changing the x-axis labels in plot()

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Fri 24 Feb 2006 - 04:15:39 EST

On 2/23/2006 10:35 AM, michael watson (IAH-C) wrote:
> Hi
>
> Hopefully this one isn't in the manual or I am about to get shot :-S
>
> One of my colleagues wants a slightly strange graph. We basically have
> a data matrix, and she wants to plot, for each row, the values in the
> row as points on the graph. The following code draws the graph just
> fine:
>
> plot(row(d)[,3:9],d[,3:9])
>
> So as there are 12 rows in my matrix, there are 12 columns of points,
> which is what she wants.
>
> However, she wants the x-axis labelled with the row names, not with
> 1,2,3,4,5 etc
>
> I can figure out from reading par() how to turn off the default drawing
> of the numerical labels, but how do I use the row names instead?

Use the axis() function. The x-axis is side=1; labels can be a character vector containing anything you like.

Duncan Murdoch



R-help@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 Received on Fri Feb 24 06:14:11 2006

This archive was generated by hypermail 2.1.8 : Fri 24 Feb 2006 - 09:08:58 EST