Message-ID: <26A86AA2-17D2-4584-9C1A-9BDF8D3D713D@verizon.net>
Date: 2012-02-21T00:03:16Z
From: Gerard Smits
Subject: question on axis labels
In-Reply-To: <CAM_vjumxeT_O5eHFgziu6KQaJc+2egWgbRPQQ2+Vkj4-wYy28g@mail.gmail.com>
Worked like a charm! Thanks for your help. Gerard
On Feb 20, 2012, at 3:52 PM, Sarah Goslee wrote:
> This works for me:
>
>> plot(0:6, runif(7), xaxt="n")
>> axis(1, at=0:6, labels=c("08:00", "12:00", "16:00", "20:00", "24:00", "04:00", "08:00"), cex=0.8)
>>
>
> You need the xaxt="n" in the plot statement, and the correct form is at=0:6
>
> Sarah
>
> On Mon, Feb 20, 2012 at 6:39 PM, Gerard Smits <g_smits at verizon.net> wrote:
>> Hi All,
>>
>> I'm trying to label my plot axis with times (HH:MM) that correspond to a numeric index (values 0:6) for my time variable. I'd like to plot "08:00", "12:00", and so on, instead of 0 through 6.
>>
>> I have used the following line of code:
>>
>> axis(1, 0:6, labels=c("08:00", "12:00", "16:00", "20:00", "24:00", "04:00", "08:00"), cex=0.8)
>>
>> [I've used both the 0:6 and at=c(0:6), with no effect.]
>>
>> My labels come out with a 0 - 6, location dependent, superimposed over my colon in my HH:MM string. So 08:00 looks like 08000, 12:00 looks like 12100.
>>
>> Any way of suppressing the at locations?
>>
>> I'm using version 2.14.0 on a mac
>>
>> My program pulls in the following packages (not sure relevant):
>>
>> require (Hmisc)
>> require (lattice)
>> require (gplots)
>>
>>
>> Thanks for any suggestions,
>>
>> Gerard
>>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org