Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.10.9910051154040.566-100000@cbe207.gcal.ac.uk>
Date: 1999-10-05T11:58:12Z
From: Bill Simpson
Subject: problem with outer and image

I want to make a picture of a cos wave grating (pattern of fuzzy stripes).
First I try to make a plot of a cos wave:
x<-seq(1:100)
y<- 10*cos(2*pi*x*3/length(x)+0)+300
plot(x,y)
That works fine. 3 cycles of cos wave. Now try for grating.

time<-seq(1:100)
f<-function(x,time) 10*cos(2*pi*x*3/length(x)+0)+300
z<-outer(x,time,f)
image(x,time,z)
I get a vertical grating as expected, BUT now I get <1 cycle of cos
wave. Varying the frequency (3 above) does nothing. I don't understand
what I am doing wrong.

Thanks very much for any help.

Bill

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._