Adding text, customized axes, and legends R
> par(font.lab=3, cex.lab=1.5, font.main=4, cex.main=2)
> dose <- c(20, 30, 40, 45, 60)
> drugA <- c(16, 20, 27, 40, 60)
> drugB <- c(15, 18, 25, 31, 40)
> opar <- par(no.readonly=TRUE)
> par(pin=c(2, 3))
> par(lwd=2, cex=1.5)
> par(cex.axis=.75, font.axis=3)
> plot(dose, drugA, type="b", pch=19, lty=2, col="red")
> plot(dose, drugB, type="b", pch=23, lty=6, col="blue", bg="green")
> plot(dose, drugA, type="b",
+ col="red", lty=4, pch=5, lwd=2,
+ main="Clinical Trials for Drug A",
+ sub="This is hypothetical data",
+ xlab="Dosage", ylab="Drug Response",
+ xlim=c(0, 60), ylim=c(0, 70))
> par(font.lab=3, cex.lab=1.5, font.main=4, cex.main=2)
> dose <- c(20, 30, 40, 45, 60)
> drugA <- c(16, 20, 27, 40, 60)
> drugB <- c(15, 18, 25, 31, 40)
> opar <- par(no.readonly=TRUE)
> par(pin=c(2, 3))
> par(lwd=2, cex=1.5)
> par(cex.axis=.75, font.axis=3)
> plot(dose, drugA, type="b", pch=19, lty=2, col="red")
> plot(dose, drugB, type="b", pch=23, lty=6, col="blue", bg="green")
> plot(dose, drugA, type="b",
+ col="red", lty=4, pch=5, lwd=2,
+ main="Clinical Trials for Drug A",
+ sub="This is hypothetical data",
+ xlab="Dosage", ylab="Drug Response",
+ xlim=c(0, 60), ylim=c(0, 70))
0 Comments