Skip to content
Back to formatted view

Raw Message

Message-ID: <CAEPexpw-MQ5DWnn6cqBE4Qu+ytGg0u9WcFAy-yr1FMbW2HS5Cw@mail.gmail.com>
Date: 2017-02-04T17:14:01Z
From: Riyas MJ
Subject: Gradient color to a line graph

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 would like to make it in rainbow colors.
Tried to do my own and tried searching but everywhere its about giving
gradient to point graph, not to a line graph. Please help, it is needed for
my work.

Thanks in advance
-- 
Riyas MJ
Project assistant (PA -II)
Physical Oceanography Department (POD)
CSIR- National Institute of Oceanography (NIO)
Dona Paula, Goa - 403 004, India
Ph: +91 9037553320, +91 7083030397

	[[alternative HTML version deleted]]