plot(C$Ymd,C$Spots,type="l",ylab="Sunspots",xlab="Year",col="black",lwd="1")
lines(C$Ymd,C$ma30,type="l", col="red")
lines(C$Ymd,C$ma90,type="l", col="green")
grid(col="black")
legend(2000,9.5,c("ma30","ma90"), # puts text in the legend
lty=c(1,1), # gives the legend appropriate symbols (lines)
lwd=c(2.5,2.5),col=c("red","green")) # gives the legend lines the correct color and width