[R] Line plot with date-time on X-axis

Malladi, Sukhaswami smalladi at lexgen.com
Sun Nov 3 21:19:42 CET 2002


Dear dr.Sarkar,

Thanks for your response. My dates are already formatted. 
I was having problems to display them as X-axis tick labels. 
I was searching the archives and found axis() to be relevant.
I played with its parameters a little and got what I wanted :-

If V1 is a list of Dates, V2 list of Times, V3 list of
Temperatures,

vx <- as.character(paste(V1,V2,sep=" "))
plot(V3,main="Temperature plot",xlab="",xaxt="n",
	type="o", ylab="Temp. in Deg.") 
axis(1,1:length(vx),labels=vx,cex.axis=0.6,las=2)

Thanks again
sukhaswami 

-----Original Message-----
From: Deepayan Sarkar [mailto:deepayan at stat.wisc.edu]
Sent: Friday, November 01, 2002 5:58 PM
To: Malladi, Sukhaswami; r-help at stat.math.ethz.ch
Subject: Re: [R] Line plot with date-time on X-axis


On Friday 01 November 2002 02:24 pm, Malladi, Sukhaswami wrote:
> Dear List,
>
> What is the way in R to plot a graph having date time (e.g. format
> 12/31/2002 13:12) in the
> x axis and numerical value (e.g. temperature) on the Y-axis ?

If you have your dates as strings, you need to use strptime() to convert
that 
into date-time objects first.


> I could not get 'plot()' to do this as X axis values are non-numeric.
> 'bwplot()' sorts the date
> values and thereby changes the order of the dates and of Y. The date/time
> values have to be
> shown on the X-axis as tick values rotated by 90 deg. as there more than
> 100 points.
>
> I appreciate your suggestions and hints.
>
> Thanks
> sukhaswami
> Lexicon Genetics
>
>
>
***************************************************************************
>  The contents of this communication are intended only for the addressee
and
> may contain confidential and/or privileged material. If you are not the
> intended recipient, please do not read, copy, use or disclose this
> communication and notify the sender.  Opinions, conclusions and other
> information in this communication that do not relate to the official
> business of my company shall be understood as neither given nor endorsed
by
> it.
>
***************************************************************************
>
>
>
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>.-.- r-help mailing list -- Read
> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or
> "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>._._


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._


*************************************************************************** 
 The contents of this communication are intended only for the addressee and
may contain confidential and/or privileged material. If you are not the
intended recipient, please do not read, copy, use or disclose this
communication and notify the sender.  Opinions, conclusions and other
information in this communication that do not relate to the official
business of my company shall be understood as neither given nor endorsed by
it.  
*************************************************************************** 


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list