: [R] R plot problems

2004-10-17 Thread Ivy_Li
Thank you for your help!
I gave you an example, you could run it in R . Maybe you will understand my meaning 
clearly.

x - data.frame(main.name=AAA, x.name=rep(c(Apply,Watermelon,Lemon,Banana,

Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5), 
y.name=(1:55))
plot(x$x.name, x$y.name)

I can't find you said package ,whick library should I include in R ?




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: [EMAIL PROTECTED]



--
: Henric Nilsson [mailto:[EMAIL PROTECTED]
: 20041015 17:39
: Ivy_Li
: [EMAIL PROTECTED]
: Re: [R] R plot problems


At 16:17 2004-10-15 +0800, you wrote:

[...] I want to rotate the direction of  x-coordinates' letter so that it 
can show all. But I don't know how to write this option or function .

I'm not sure if I've understood your question correctly. But if you use 
base graphics and want e.g. rotated labels, you'll achive this rather 
easily using functions in the gridBase package. (Take a look at the package 
vignette for an  example that'll get you started.)

Henric

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: : [R] R plot problems

2004-10-17 Thread Bobby Corpus
Hi Ivy,

How about

x - data.frame(main.name=AAA,
x.name=rep(c(Apply,Watermelon,Lemon,Banana,
   
Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5),
y.name=(1:55))
par(las=2);
plot(x$x.name, x$y.name)

Bobby

On Mon, 18 Oct 2004 09:36:12 +0800, Ivy_Li [EMAIL PROTECTED] wrote:
 Thank you for your help!
 I gave you an example, you could run it in R . Maybe you will understand my meaning 
 clearly.
 
 x - data.frame(main.name=AAA, x.name=rep(c(Apply,Watermelon,Lemon,Banana,
 
 Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5), 
 y.name=(1:55))
 plot(x$x.name, x$y.name)
 
 I can't find you said package ,whick library should I include in R ?
 
 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: [EMAIL PROTECTED]
 
 --
 : Henric Nilsson [mailto:[EMAIL PROTECTED]
 : 20041015 17:39
 : Ivy_Li
 : [EMAIL PROTECTED]
 : Re: [R] R plot problems
 
 At 16:17 2004-10-15 +0800, you wrote:
 
 [...] I want to rotate the direction of  x-coordinates' letter so that it
 can show all. But I don't know how to write this option or function .
 
 I'm not sure if I've understood your question correctly. But if you use
 base graphics and want e.g. rotated labels, you'll achive this rather
 easily using functions in the gridBase package. (Take a look at the package
 vignette for an  example that'll get you started.)
 
 Henric
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


: : [R] R plot problems

2004-10-17 Thread Ivy_Li
Yes! You are right ! It is perpendicular to the axis.
 Thank you very much!
Could I choose the angle ,such as 45 degree?




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: [EMAIL PROTECTED]



--
: Bobby Corpus [mailto:[EMAIL PROTECTED]
: 20041018 10:01
: Ivy_Li
: Henric Nilsson; [EMAIL PROTECTED]
: Re: : [R] R plot problems


Hi Ivy,

How about

x - data.frame(main.name=AAA,
x.name=rep(c(Apply,Watermelon,Lemon,Banana,
   
Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5),
y.name=(1:55))
par(las=2);
plot(x$x.name, x$y.name)

Bobby

On Mon, 18 Oct 2004 09:36:12 +0800, Ivy_Li [EMAIL PROTECTED] wrote:
 Thank you for your help!
 I gave you an example, you could run it in R . Maybe you will understand my meaning 
 clearly.
 
 x - data.frame(main.name=AAA, x.name=rep(c(Apply,Watermelon,Lemon,Banana,
 
 Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5), 
 y.name=(1:55))
 plot(x$x.name, x$y.name)
 
 I can't find you said package ,whick library should I include in R ?
 
 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: [EMAIL PROTECTED]
 
 --
 : Henric Nilsson [mailto:[EMAIL PROTECTED]
 : 20041015 17:39
 : Ivy_Li
 : [EMAIL PROTECTED]
 : Re: [R] R plot problems
 
 At 16:17 2004-10-15 +0800, you wrote:
 
 [...] I want to rotate the direction of  x-coordinates' letter so that it
 can show all. But I don't know how to write this option or function .
 
 I'm not sure if I've understood your question correctly. But if you use
 base graphics and want e.g. rotated labels, you'll achive this rather
 easily using functions in the gridBase package. (Take a look at the package
 vignette for an  example that'll get you started.)
 
 Henric
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: ??: [R] R plot problems

2004-10-17 Thread Austin, Matt
The following should work, note I made x.name a factor.

x - data.frame(main.name=AAA,
x.name=factor(rep(c(Apply,Watermelon,Lemon,Banana,
 
Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5))
,
   y.name=(1:55))

plot(x$x.name, x$y.name, axes=FALSE)
axis(1, at=1:length(levels(x$x.name)), lab=FALSE)
axis(2)
box()
text(1:length(levels(x$x.name)), par('usr')[3]-par('cxy')[2]*.5,
levels(x$x.name), offset=1, xpd=TRUE, srt=-45, adj=0)


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ivy_Li
Sent: Sunday, October 17, 2004 19:27 PM
To: Bobby Corpus
Cc: Henric Nilsson; [EMAIL PROTECTED]
Subject: ??: ??: [R] R plot problems


Yes! You are right ! It is perpendicular to the axis.
 Thank you very much!
Could I choose the angle ,such as 45 degree?




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: [EMAIL PROTECTED]



--
: Bobby Corpus [mailto:[EMAIL PROTECTED]
: 20041018 10:01
: Ivy_Li
: Henric Nilsson; [EMAIL PROTECTED]
: Re: : [R] R plot problems


Hi Ivy,

How about

x - data.frame(main.name=AAA,
x.name=rep(c(Apply,Watermelon,Lemon,Banana,
 
Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5),
y.name=(1:55))
par(las=2);
plot(x$x.name, x$y.name)

Bobby

On Mon, 18 Oct 2004 09:36:12 +0800, Ivy_Li [EMAIL PROTECTED] wrote:
 Thank you for your help!
 I gave you an example, you could run it in R . Maybe you will understand
my meaning clearly.
 
 x - data.frame(main.name=AAA,
x.name=rep(c(Apply,Watermelon,Lemon,Banana,

Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawberry),each=5),
y.name=(1:55))
 plot(x$x.name, x$y.name)
 
 I can't find you said package ,whick library should I include in R ?
 
 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: [EMAIL PROTECTED]
 
 --
 : Henric Nilsson [mailto:[EMAIL PROTECTED]
 : 20041015 17:39
 : Ivy_Li
 : [EMAIL PROTECTED]
 : Re: [R] R plot problems
 
 At 16:17 2004-10-15 +0800, you wrote:
 
 [...] I want to rotate the direction of  x-coordinates' letter so that it
 can show all. But I don't know how to write this option or function .
 
 I'm not sure if I've understood your question correctly. But if you use
 base graphics and want e.g. rotated labels, you'll achive this rather
 easily using functions in the gridBase package. (Take a look at the
package
 vignette for an  example that'll get you started.)
 
 Henric
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: :: [R] R plot problems

2004-10-17 Thread Gabor Grothendieck

Check out:

  http://maths.newcastle.edu.au/~rking/R/help/02b/2873.html

Ivy_Li Ivy_Li at smics.com writes:

: 
: Yes! You are right ! It is perpendicular to the axis.
:  Thank you very much!
: Could I choose the angle ,such as 45 degree?
: 
: 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
: 
: 
: --
: : Bobby Corpus [mailto:bobby.corpus at gmail.com]
: : 20041018 10:01
: : Ivy_Li
: : Henric Nilsson; r-help at stat.math.ethz.ch
: : Re: : [R] R plot problems
: 
: 
: Hi Ivy,
: 
: How about
: 
: x - data.frame(main.name=AAA,
: x.name=rep(c(Apply,Watermelon,Lemon,Banana,
:Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawbe
rry),each=5),
: y.name=(1:55))
: par(las=2);
: plot(x$x.name, x$y.name)
: 
: Bobby
: 
: On Mon, 18 Oct 2004 09:36:12 +0800, Ivy_Li ivy_li at smics.com wrote:
:  Thank you for your help!
:  I gave you an example, you could run it in R . Maybe you will understand 
my meaning clearly.
:  
:  x - data.frame(main.name=AAA, x.name=rep(c
(Apply,Watermelon,Lemon,Banana,
: 
: Grape,Pineapply,Cherry,Peach,Orange,Mango,Strawb
erry),each=5), y.name=(1:55))
:  plot(x$x.name, x$y.name)
:  
:  I can't find you said package ,whick library should I include in R ?
:  
:  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
:  
:  --
:  : Henric Nilsson [mailto:henric.nilsson at statisticon.se]
:  : 20041015 17:39
:  : Ivy_Li
:  : r-help at stat.math.ethz.ch
:  : Re: [R] R plot problems
:  
:  At 16:17 2004-10-15 +0800, you wrote:
:  
:  [...] I want to rotate the direction of  x-coordinates' letter so that it
:  can show all. But I don't know how to write this option or function .
:  
:  I'm not sure if I've understood your question correctly. But if you use
:  base graphics and want e.g. rotated labels, you'll achive this rather
:  easily using functions in the gridBase package. (Take a look at the package
:  vignette for an  example that'll get you started.)
:  
:  Henric
:  
:  __
:  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
: 
: 
: __
: 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
: 
:

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


??: [R] R plot problems

2004-10-17 Thread Ivy_Li
About Time labels, I have tried you mentioned method , but It still show oddness number
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: [EMAIL PROTECTED]



--
???: Jim Lemon [mailto:[EMAIL PROTECTED]
: 2004?10?17? 18:28
???: Ivy_Li
??: Re: [R] R plot problems


Ivy_Li wrote:
 Hello Everyboby:
 Could I consult everyboby two problems about plot.
 Recently, I am doing some analysis in plot.
 Now I can draw boxplot in R , but the result's plot loss some of
 the x-coordinates. I want to rotate the direction of  x-coordinates' letter
 so that it can show all. But I don't know how to write this option or
 function . Or Could you carry out some other good measures to help me?

If you are trying to cram a lot of labels on an axis, the staxlab function 
in the plotrix package may help you.

 The
 second problem, x-axis in the plot I drawed is time , but the figure in it 
 is very oddness. For example, the time is 2004-9-29, the figure in the plot
 is 109500.Could anyone help me to settle these problems. Thank you very
 much!

This looks like a date problem. The date is being converted to one of the 
seconds-since-x timescales and printed as that value. Try converting your 
original dates to labels using as.character.

Jim

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R plot problems

2004-10-15 Thread Henric Nilsson
At 10:51 2004-10-15 +0100, you wrote:
If you are using base grafics, you use the argument srt (see help(par)),
How do you get a, say, 45 degree rotation of the axis labels using `srt'? 
The help page for par's `las' argument says

Note that other string/character rotation (via argument srt to par) does 
not affect the axis labels

Henric
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R plot problems

2004-10-15 Thread Marc Schwartz
On Fri, 2004-10-15 at 07:18, Henric Nilsson wrote:
 At 10:51 2004-10-15 +0100, you wrote:
 
 If you are using base grafics, you use the argument srt (see help(par)),
 
 How do you get a, say, 45 degree rotation of the axis labels using `srt'? 
 The help page for par's `las' argument says
 
 Note that other string/character rotation (via argument srt to par) does 
 not affect the axis labels
 
 Henric

See the new R FAQ:

7.27 How can I create rotated axis labels?

HTH,

Marc Schwartz

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] R plot problems

2004-10-15 Thread Liaw, Andy
Use text(), for which srt will work.  As an example:

plot(rnorm(20), rnorm(20), xaxt=n)
text(-2:2, rep(par(usr)[3], 5), 
 c(negative two, negative one, zero, one, two),
 srt=45, xpd=NA, adj=1)

HTH,
Andy

 From: Henric Nilsson
 
 At 10:51 2004-10-15 +0100, you wrote:
 
 If you are using base grafics, you use the argument srt (see 
 help(par)),
 
 How do you get a, say, 45 degree rotation of the axis labels 
 using `srt'? 
 The help page for par's `las' argument says
 
 Note that other string/character rotation (via argument srt 
 to par) does 
 not affect the axis labels
 
 Henric
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html