Mike Livermore - Week 1 Assignment - Sept. 13, 2010

Graphics

1.2 - points(x,y,pch="+",cex=2,col="purple")


 

1.4 -

lines(x,y1,col="red",lty="solid",lwd=1)

lines(x,y2,col="purple",lty="dashed",lwd=2)

lines(x,y3,col="orange",lty="dotted",lwd=2)

lines(x4,y4,col="black",lty="dashed",lwd=4)


 

1.5 –

plot(x,y,col="blue")

points(x[hull],y[hull],col="orange",cex=1,pch=16)

polygon(x[hull],y[hull],density=0,col="green",lwd=2)


 

2.1 –

x = rnorm(100)

y = rnorm(100)

axis(side=1,at=1:7,tck=1,labels=c('Sun','Mon','Tue','Wed','Thu','Fri','Sat'), mgp=c(2,.2,0), col="orange")


 

4 – Sample unchanged


 

4 - Script (changed)
 
angles = seq(0,2*pi,length=101)
cosAngles = cos(angles)
sinAngles = sin(angles)
xRange = c(-10,10)
yRange = c(-10,10)
radii  = 1:4 
windows(width=6,height=6)

colorMat = matrix(c(

         .00, .00, .00,    # black

       1.00,1.00,1.00,    # white

        .92, .92, .92,    # light gray

        .20, .60,1.00),   # light greenish blue

        ncol=3,byrow=T)

palette(rgb(colorMat[,1],colorMat[,2],colorMat[,3]))

par(pty='s')

plot(xRange,yRange,type='n',axes=F,xlab='',ylab='',
main='Cognitively Constructed Square')
 
cen.x = -5; cen.y = 5; subs = 76:101

for (i in 1:4)lines(radii[i]*cosAngles+cen.x,radii[i]*sinAngles+cen.y,lwd=2)
for (i in 1:4)lines(radii[i]*cosAngles[subs]+cen.x,radii[i]*sinAngles[subs]+cen.y,col="red")

cen.x = -5; cen.y = -5; subs = 1:26
for (i in 1:4)lines(radii[i]*cosAngles+cen.x,radii[i]*sinAngles+cen.y,lwd=2)
for (i in 1:4)lines(radii[i]*cosAngles[subs]+cen.x,radii[i]*sinAngles[subs]+cen.y,col="red")

cen.x = 5; cen.y = 5; subs = 51:76
for (i in 1:4)lines(radii[i]*cosAngles+cen.x,radii[i]*sinAngles+cen.y,lwd=2)
for (i in 1:4)lines(radii[i]*cosAngles[subs]+cen.x,radii[i]*sinAngles[subs]+cen.y,col="red")

cen.x = 5; cen.y = -5; subs = 26:51 

for (i in 1:4)lines(radii[i]*cosAngles+cen.x,radii[i]*sinAngles+cen.y,lwd=2)
for (i in 1:4)lines(radii[i]*cosAngles[subs]+cen.x,radii[i]*sinAngles[subs]+cen.y,col="red")


 

4 – Revised Graphic


 

Name Mapper: