=?gb2312?B?tPC4tDogW1JdIEhvdyB0byBkcmF3IHgtYXhpcyB0aW1lIGxhYmVsLg==?=
Ivy_Li
Ivy_Li at smics.com
Fri Oct 22 08:34:50 CEST 2004
Thank you for helping me.
I have modified this part of code.
Time <- c("2004-08-05 09:08:48", "2004-08-13 20:53:38",
"2004-08-14 13:57:23", "2004-08-12 16:17:41",
"2004-08-12 16:15:27", "2004-08-11 21:38:24",
"2004-08-12 14:28:41", "2004-08-18 18:04:47",
"2004-08-13 15:23:14", "2004-08-14 02:36:33")
Time <- as.POSIXct(Time)
x <- data.frame(main.name="AAA", fruit.name=rep(c("Apply","Watermelon"),each=5),
x.name=Time, y.name=(1:10))
par(las=3,mai=c(1,.7,.5,.3))
plot(x$x.name,as.character(x$y.name),pch=26, xlab="Process Time", xaxt = 'n')
axis.POSIXct(1, at=seq(min(x$x.name), max(x$x.name), "days"),format="%d /%m")
fruit.class <- table(x$fruit.name)
color.code <- c(611,552,656,121,451,481,28,652,32,550,90,401,150,12,520,8)
for(j in 1:length(fruit.class))
{
fruit <- names(fruit.class)[j]
lines(smooth.spline(x[x$fruit.name==fruit, "x.name"],
x[x$fruit.name==fruit, "y.name"],df=5),
col=colors()[color.code[j]],lwd=5)
}
Run above code , you will find the "Process Time" is close to the x-label, I want to move it down . And How can I reduce font?
Thank you very much!
Best Regards!
Ivy Li£¨Ãîè¡£©
YMS in Production & Testing
Semiconductor Manufactory International(ShangHai) Corporation
#18 ZhangJiang Road, PuDong New Area, Shanghai, China
Tel: 021-5080-2000 *11754
Email: Ivy_Li at smics.com
-----orig---
In this case, don't draw x-axis:
plot(x$x.name,as.character(x$y.name),pch=26, xaxt = 'n')
Then check out functin mtext() (to draw the xaxis yourself. It's not
diffucult but you have to try).
Luck
Huang Huan
Internet
Ivy_Li at smics.com - 10/19/2004 10:23 AM
To: Huan HUANG
cc: r-help
Subject: ´?¸´: ´?¸´: ´?¸´: [R] How to draw x-axis time label.
Thank you !
I run your code. It have a graph with time(date) on x-axis. Thank you very
much!
Well, Would you like to do me a favor again?
Most of times, the x-axis time data is lasted about 3 months. They are too
much. I must select some of them marking in x-axis,and they are must
reasonable and human-readable. Now I have tried the "pretty " function,
But as soon as I run it, the format of data changed to "numeric" ,I don't
know what should I do. Is there exist other functions can get the same
result?
Best Regards!
Ivy Li£¨Ãîè¡£©
YMS in Production & Testing
Semiconductor Manufactory International(ShangHai) Corporation
#18 ZhangJiang Road, PuDong New Area, Shanghai, China
Tel: 021-5080-2000 *11754
Email: Ivy_Li at smics.com
-----ÃÂüÃüþ-----
·¢¼þÃÃ: huan.huang at uk.bnpparibas.com
[mailto:huan.huang at uk.bnpparibas.com]
·¢ÃÃñ¼ä: 2004Ãê10ÃÃ19Ãà 16:43
ÃüþÃÃ: Ivy_Li
Ã÷Ãâ: Re: ´?¸´: ´?¸´: [R] How to draw x-axis time label.
Hi Li chen,
I mean you should run the code I sent you in my first email. It's here
again:
plot(x$x.name,as.character(x$y.name),pch=26)
By running this you should have a graph with time(date) on x-axis.
Give it a go? Let me know if it is not working.
Huang Huan
Internet
Ivy_Li at smics.com - 10/19/2004 02:18 AM
To: Huan HUANG
cc:
Subject: ´?¸´: ´?¸´: [R] How to draw x-axis time label.
Put *time* on x-axis? Like this:
>plot(time(x$x.name),as.character(x$y.name),pch=26)
but the x-axis is not real time , just some number.
I forgot your question in your previous mail. :-)
My chinese name is Li Chen
hello!
Best Regards!
Ivy Li£¨Ãîè¡£©
YMS in Production & Testing
Semiconductor Manufactory International(ShangHai) Corporation
#18 ZhangJiang Road, PuDong New Area, Shanghai, China
Tel: 021-5080-2000 *11754
Email: Ivy_Li at smics.com
-----ÃÂüÃüþ-----
·¢¼þÃÃ: huan.huang at uk.bnpparibas.com
[mailto:huan.huang at uk.bnpparibas.com]
·¢ÃÃñ¼ä: 2004Ãê10ÃÃ18Ãà 18:35
ÃüþÃÃ: Ivy_Li
Ã÷Ãâ: Re: ´?¸´: [R] How to draw x-axis time label.
Come on, Ivy. Did you try the line in my previous email? That will put
*time* on x-axis. Give it a go?
Internet
Ivy_Li at smics.com - 10/18/2004 10:24 AM
To: Huan HUANG
cc:
Subject: ´?¸´: [R] How to draw x-axis time label.
Thank you !
I know the oddness number are time calulated since 1970, but i need them to
be x-axis .
What should I do ?
Best Regards!
Ivy Li£¨Ãîè¡£©
YMS in Production & Testing
Semiconductor Manufactory International(ShangHai) Corporation
#18 ZhangJiang Road, PuDong New Area, Shanghai, China
Tel: 021-5080-2000 *11754
Email: Ivy_Li at smics.com
-----ÃÂüÃüþ-----
·¢¼þÃÃ: huan.huang at uk.bnpparibas.com
[mailto:huan.huang at uk.bnpparibas.com]
·¢ÃÃñ¼ä: 2004Ãê10ÃÃ18Ãà 16:50
ÃüþÃÃ: Ivy_Li
Ã÷Ãâ: Re: [R] How to draw x-axis time label.
Hi Ivy (any chinese name?)
I ran your codes. I found if I try:
plot(x$x.name,as.character(x$y.name),pch=26,)
It would put time as the x axis. The *odd* numbers showed in yoru graph as
the moment are numbers of seconds of those dates since the beginning of
1970.
Hope it helps.
Huang Huan
Internet
Ivy_Li at smics.com@stat.math.ethz.ch - 10/18/2004 07:26 AM
Sent by: r-help-bounces at stat.math.ethz.ch
To: r-help
cc:
Subject: [R] How to draw x-axis time label.
Hi everybody,
Could I consult one problem?
It is about plot
Now I do some analysis in plot . I need to draw a plot which x-axis is
time . But when I run the funtion of plot . The x-label are very oddness
number, such as the time is "2004-08-05 09:08:48", but the x-label is
1091800000. I don't know how to do .
I have an example . Mybe It can explain my meaning clearly.
Thank you for helping me!
Time <- c("2004-08-05 09:08:48", "2004-08-13 20:53:38",
"2004-08-14 13:57:23", "2004-08-12 16:17:41",
"2004-08-12 16:15:27", "2004-08-11 21:38:24",
"2004-08-12 14:28:41", "2004-08-18 18:04:47",
"2004-08-13 15:23:14", "2004-08-14 02:36:33")
Time <- as.POSIXlt(Time)
x <- data.frame(main.name="AAA",
fruit.name=rep(c("Apply","Watermelon"),each=5),
x.name=Time, y.name=(1:10))
plot(as.numeric(x$x.name),as.character(x$y.name),pch=26,)
fruit.class <- table(x$fruit.name)
color.code <- c(611,552,656,121,451,481,28,652,32,550,90,401,150,12,520,8)
for(j in 1:length(fruit.class))
{
fruit <- names(fruit.class)[j]
lines(smooth.spline(x[x$fruit.name==fruit, "x.name"],
x[x$fruit.name==fruit, "y.name"],df=5),
col=colors()[color.code[j]],lwd=5)
}
Best Regards!
Ivy Li£¨Ãîè¡£©
YMS in Production & Testing
Semiconductor Manufactory International(ShangHai) Corporation
#18 ZhangJiang Road, PuDong New Area, Shanghai, China
Tel: 021-5080-2000 *11754
Email: Ivy_Li at smics.com
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????
?????????????????????????????????????????????????
????????????????????????????????????????????????????
?????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????
???????????????
??
???????????????????????????????????????????????????????
??????????????????????????????????????????????
????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????
?????????????????????????????????????????????????
????????????????????????????????????????????????????
?????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????
???????????????
??
???????????????????????????????????????????????????????
??????????????????????????????????????????????
????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????
?????????????????????????????????????????????????
????????????????????????????????????????????????????
?????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????
???????????????
??
???????????????????????????????????????????????????????
??????????????????????????????????????????????
????????????????????????????????????????????????????
????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????????
?????????????????????????????????????????????????
????????????????????????????????????????????????????
?????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
???????????????????????????????????????????????????????????
???????????????
???????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????
???????????????
??
???????????????????????????????????????????????????????
??????????????????????????????????????????????
More information about the R-help
mailing list