Re: [R] Problem at adding lines on a graphics with lines() function

2009-11-20 Thread Jorge Ivan Velez
Hi Anna, I guess it happened because the range of datas[1:n, 2] differs from the range of datas[1:n, 3]. A workaround would be either to use the maplot() function as follows or figuring out their ranges and then plug them in as the ylim argument in the plot call. Here is a suggestion using matplo

Re: [R] Problem at adding lines on a graphics with lines() function

2009-11-20 Thread David Winsemius
On Nov 20, 2009, at 1:56 PM, anna_l wrote: Hello, I am trying to plot a graphic with many lines with the following command: plot(datas[1:n,1],datas[1:n,2],type="l",main="SP500 Prices and Moving Averages",xlab="Date",ylab="Prices",col="black") lines(datas[1:n,1],datas[1:n,3],type="l",col="g

[R] Problem at adding lines on a graphics with lines() function

2009-11-20 Thread anna_l
Hello, I am trying to plot a graphic with many lines with the following command: plot(datas[1:n,1],datas[1:n,2],type="l",main="SP500 Prices and Moving Averages",xlab="Date",ylab="Prices",col="black") lines(datas[1:n,1],datas[1:n,3],type="l",col="green",lty="solid") But I just see the first curve