Skip to content
Back to formatted view

Raw Message

Message-ID: <20040203091347.GA1049@nf034.jinr.ru>
Date: 2004-02-03T09:13:47Z
From: Timur Elzhov
Subject: R: plotting multiple functions
In-Reply-To: <401F54E3.7540EF5D@stats.uct.ac.za>

On Tue, Feb 03, 2004 at 09:59:31AM +0200, allan clark wrote:

> Another simple question.
> 
> I would like to plot three graphs one the same plot with different
> colours. Say red, blue and black. Here are the functions.
> 
> r1<-1+5*cos(2*pi*seq(1:100)/20)+rnorm(100)
> r2<-1+7*sin(2*pi*seq(1:100)/20)+rnorm(100)
> r3<-1+7*sin(2*pi*seq(1:100)/20)+5*cos(2*pi*seq(1:100)/20)+rnorm(100)

plot(r1, type = "n")
points(r1, col = "red", pch = 19)  ## see also ?lines
points(r2, col = "blue", pch = 19)
points(r3, col = "black", pch = 19)