Skip to content
Prev 180346 / 398525 Next

replacing default axis labels on a plot

Thanks.  But ... Still don't get it.

Referring explicitly to the monthname column which had many entries
across many years did not work.  So taking your clue I created a new
variable list of names of month

month.name<-list(c("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec"))

then issued this command

plot(flow~factor(month),xlab="Month",ylab="Total Flow per Month",
ylim=c(0,55000), xaxt="n", axis(1, at=1:12, labels=month.name))

which gave this error

ERROR: 12, labels = month.name)

Gregory A. Graves
Lead Scientist
REstoration COoordination and VERification (RECOVER) 
Watershed Division
South Florida Water Management District
Phones:  DESK: 561 / 682 - 2429 
             CELL:  561 / 719 - 8157
             
 

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca] 
Sent: Thursday, May 14, 2009 8:12 AM
To: Graves, Gregory
Cc: r-help at r-project.org
Subject: Re: [R] replacing default axis labels on a plot
On 14/05/2009 7:31 AM, Graves, Gregory wrote:
and
ticks.lab is not a parameter to the plot.formula function.  You don't 
say where you found it described, but I'd suggest you read your source 
more closely, or just use xaxt="n" in the plot call, and construct your 
own call to axis(), e.g. axis(1, at=1:12, labels=monthname).

Duncan Murdoch
http://www.R-project.org/posting-guide.html