Re: [R] LInes with types

2014-05-28 Thread Jim Lemon
On Wed, 28 May 2014 01:20:33 AM ioanna ioannou wrote:
> X1<-c(0,1,2,3,4)
> 
> Y1<-c(0,1,2,3,4)
> 
>  
> 
> Y2<-c(5,6,7,8,9)
> 
>  
> 
> Y3<-(32,33,34,35,36)
> 
>  
> 
> plot(X1,Y3,pch=20)
> 
> lines(X1,Y1,lty=1,type='o')
> 
> lines(X1,Y2,lty=1,type='b')
> 
> lines(X1,Y3,lty=2)

Hi Ioanna,
You actually have three lines, and on that basis I suggest (with corrected 
example):

X1<-c(0,1,2,3,4)
Y1<-c(0,1,2,3,4)
Y2<-c(5,6,7,8,9)
Y3<-c(32,33,34,35,36)
plot(X1,Y3,pch=20,ylim=c(0,36))
lines(X1,Y1,lty=1,type='o')
lines(X1,Y2,lty=1,type='b')
lines(X1,Y3,lty=2)
legend(1.5,25,paste("Number",1:3),lty=c(1,1,3),pch=c(1,1,20))

Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] LInes with types

2014-05-27 Thread ioanna ioannou
Hello all, 

 

I want to plot the legend for the following two lines:

I have two lines:

 

X1<-c(0,1,2,3,4)

Y1<-c(0,1,2,3,4)

 

Y2<-c(5,6,7,8,9)

 

Y3<-(32,33,34,35,36)

 

plot(X1,Y3,pch=20)

lines(X1,Y1,lty=1,type='o')

lines(X1,Y2,lty=1,type='b')

lines(X1,Y3,lty=2)

 

Any ideas how?

 

Best 

IOanna


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.