Try this. Made up some data with year values:
myDates <- seq(2009, 2011, .01) # create some dates
myData <- runif(length(myDates))
plot(myDates, myData)
# now convert to a Date by determining what the date of the first value is
first <- as.Date(paste(floor(min(myDates)), '-1-1', sep = ''))
# add
Hi Jim,
Yes you are right, file$time is decimal date. In the attached plot I want to
replace decimal
date with proper time axis so I can show month ticks. Decimal date misleads
sometime
while interpretation. Data varies from Jan-Dec 2009.
Thanks,
Yogesh
On Tue, Dec 21, 2010 at 9:57 PM, jim holt
Em 21/12/2010 14:35, peter dalgaard escreveu:
On Dec 21, 2010, at 17:01 , Edwin Groot wrote:
On Tue, 21 Dec 2010 18:06:52 +0530
Yogesh Tiwari wrote:
Hi,
I want 12 ticks at axis 1 and want to write Jan-Dec on each.
something like:
axis(1, at=1:12,
labels=c('J','F','M','A','M','J','J','A','S
I'm not sure, but perhaps you want to
copy the logic of:
http://www.portfolioprobe.com/R/blog/pp.timeplot.R
On 21/12/2010 12:36, Yogesh Tiwari wrote:
Hi,
I want 12 ticks at axis 1 and want to write Jan-Dec on each.
something like:
axis(1, at=1:12, labels=c('J','F','M','A','M','J','J','A','S',
On Dec 21, 2010, at 17:01 , Edwin Groot wrote:
> On Tue, 21 Dec 2010 18:06:52 +0530
> Yogesh Tiwari wrote:
>> Hi,
>> I want 12 ticks at axis 1 and want to write Jan-Dec on each.
>>
>> something like:
>>
>> axis(1, at=1:12,
>> labels=c('J','F','M','A','M','J','J','A','S','O','N','D'))
>>
>> I
What is the structure of file$time? Is it Date/POSIXct? 'at=1:12'
only works if those are the dimensions of file$time. So give us an
idea of what the data is (PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented,
minimal, self-contained, reproducible
On Tue, 21 Dec 2010 18:06:52 +0530
Yogesh Tiwari wrote:
> Hi,
> I want 12 ticks at axis 1 and want to write Jan-Dec on each.
>
> something like:
>
> axis(1, at=1:12,
> labels=c('J','F','M','A','M','J','J','A','S','O','N','D'))
>
> I could omit default ticks but now how to control ticks.
>
De
at your X axis data, file$time, doesn't take the values 1
to 12.
Martyn
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Yogesh Tiwari
Sent: 21 December 2010 12:37
To: r-help
Subject: [R] how to control ticks
Hi,
I want 12 ticks a
Hi,
I want 12 ticks at axis 1 and want to write Jan-Dec on each.
something like:
axis(1, at=1:12, labels=c('J','F','M','A','M','J','J','A','S','O','N','D'))
I could omit default ticks but now how to control ticks.
plot(file$time, file$ch4*1000, ylim=c(1500,1700), xaxt='n', xlab= NA,
ylab=NA,col
9 matches
Mail list logo