Skip to content
Prev 581 / 885 Next

plot an angle of 450 degrees and adding a circular arrow to it

Dear Jones:

Could you please look to this R code. I am trying to graph both sin(x+pi/6)
and sin(x) in the same plot to show the shift. I used abline to graph the
sin(x), but it looked like same as the x-axis.


x<-seq(-2.2*pi,2*pi,0.01)
y<-sin(x+pi/6)


#### To draw a box of the graph:
#### ==========================

plot(0:10, 0:10, type = "n", xaxt = "n", yaxs = "i", xaxs = "i", yaxt =
"n", xlab = "", ylab = "")

plot(x, y, type='l', lwd = 3,  col="red", xaxt = "n", xlab="", ylab="")



#### abline(v=c(-4*pi,-(7*pi)/2,-3*pi,-(5*pi)/2,-2*pi,-(3*pi)/2,-pi,-pi/2,
0,pi/2,pi,(3*pi)/2,2*pi,(5*pi)/2,3*pi,(7*pi)/2,4*pi),col="blue")


abline(h=0, lwd=3)
abline(v=0, lwd=3)


x1<-seq(0,2*pi,0.01)
y1<-sin(x1)
abline(x1,y1, lwd = 3)


thank you very much
Steven
On Mon, Oct 20, 2014 at 1:08 PM, Steven Stoline <sstoline at gmail.com> wrote: