Re: [R] Gradient color to a line graph

2017-02-05 Thread Riyas MJ
Thank you so much. Both worked well. Thanks On Sun, Feb 5, 2017 at 2:27 AM, Jeff Newmiller wrote: > You haven't indicated what information you want to convey with this > gradient. > > You also are using arrays where you should be using vectors, usually > stored in a data frame. > > Here is one w

Re: [R] Gradient color to a line graph

2017-02-04 Thread Jeff Newmiller
You haven't indicated what information you want to convey with this gradient. You also are using arrays where you should be using vectors, usually stored in a data frame. Here is one way using the contributed package ggplot2: library(ggplot2) DF <- data.frame( V1=1:10, V2=11:20, C=21:30 ) p <-

Re: [R] Gradient color to a line graph

2017-02-04 Thread David Winsemius
> On Feb 4, 2017, at 9:14 AM, Riyas MJ wrote: > > Hi all, > > I am a new user of R. I just did my first real program. > I would like to know how to put a gradient (like rainbow() or topo.colors, > etc) to a* line* graph. > > Example: > ar1=array(data=1:10,dim=9) > ar2=array(data=11:20,dim=9) >

[R] Gradient color to a line graph

2017-02-04 Thread Riyas MJ
Hi all, I am a new user of R. I just did my first real program. I would like to know how to put a gradient (like rainbow() or topo.colors, etc) to a* line* graph. Example: ar1=array(data=1:10,dim=9) ar2=array(data=11:20,dim=9) plot(ar1,ar2,type="l",col="red",lwd=3) Instead of a red color, I woul