[R] X axis label as months

Prof J C Nash (U30A) nashjc at uottawa.ca
Thu Aug 22 01:04:20 CEST 2013


Thanks. The staxlab works with the plot generated by

plot(tt, data,....)

but not with

plot(tsdata, ...)

i.e., it seems to be the tsplot that somehow changes something and the 
axis commands have no effect.

I probably should have pointed out that my main concern is that I'm not 
getting any error msg. Just no axis label. And it seems I need to make 
sure the labels vector is the same length as I need -- no recycling.

JN


On 13-08-21 06:37 PM, Jim Lemon wrote:
> On 08/22/2013 07:56 AM, Prof J C Nash (U30A) wrote:
>> There are several items on the web about putting month names as tick
>> labels on x axis of time plots, but I found when I tried them they did
>> not work for me. After an hour or so of driving myself silly looking for
>> a bug in my code, I've prepared a reproducible example below, where I
>> did find a workaround, but would prefer to be able to plot a ts object.
>>
>> Perhaps someone can spot the error in this. I'm sure it's something
>> silly or fumble-fingered.
>>
>> JN
>>
> Hi,
> Try this:
>
> library(plotrix)
> staxlab(1, at=1:28, label=months)
>
> Jim
>



More information about the R-help mailing list