# Michael Minn 2/25/2018 # Linear x = 0:20 y = (x * 5) + 10 plot(x, y, type='l', col="navy", lwd=3, las=1, fg="white", font.lab=2, xaxs='i', yaxs='i', xlim=c(0, 20), ylim=c(0,120), panel.first = grid(nx=NA, ny=NULL, lty=1, col="gray"), xlab="x", ylab="y") text(5, 90, "y = (x * 5) + 10") abline(a=0, b=0, lwd=3) # Exponential x = 0:20 y = 1.2^x plot(x, y, type='l', col="navy", lwd=3, las=1, fg="white", font.lab=2, xaxs='i', yaxs='i', xlim=c(0, 20), ylim=c(0,40), panel.first = grid(nx=NA, ny=NULL, lty=1, col="gray"), xlab="x", ylab="y") text(5, 35, expression(y == 1.2^x)) abline(a=0, b=0, lwd=3) # Logarithmic x = seq(1,20,0.1) y = log(x) plot(x, y, type='l', col="navy", lwd=3, las=1, fg="white", font.lab=2, xaxs='i', yaxs='i', xlim=c(0, 20), ylim=c(0,4), panel.first = grid(nx=NA, ny=NULL, lty=1, col="gray"), xlab="x", ylab="y") text(5, 3.5, expression(y == log(x))) abline(a=0, b=0, lwd=3) # Sigmoid x = seq(0,20,0.1) y = 10 / (1 + exp(-0.6 * (x - 10))) plot(x, y, type='l', col="navy", lwd=3, las=1, fg="white", font.lab=2, xaxs='i', yaxs='i', xlim=c(0, 20), ylim=c(0,12), panel.first = grid(nx=NA, ny=NULL, lty=1, col="gray"), xlab="x", ylab="y") text(5, 9, expression(y == frac(10, 1 + e^{-0.6 * (x - 10)}))) abline(a=0, b=0, lwd=3) # Sine x = seq(0,20,0.1) y = 5 + 4 * sin(x) plot(x, y, type='l', col="navy", lwd=3, las=1, fg="white", font.lab=2, xaxs='i', yaxs='i', xlim=c(0, 20), ylim=c(0,10), panel.first = grid(nx=NA, ny=NULL, lty=1, col="gray"), xlab="x", ylab="y") text(5, 9, expression(y == 5 + (4 * sin(x)))) abline(a=0, b=0, lwd=3)