[R-sig-teaching] Shading Area
Steven Stoline
sstoline at gmail.com
Wed Nov 25 18:34:44 CET 2015
Dear All:
How to shade the area between the lines y = 3 and y = 7 (with gray color
(say), and between the lines x = 5 and x = 7? with color light blue (say).
*here is the R code:*
====================
plot(0:10, 0:10, type = "n", xaxt = "n", yaxs = "i", xaxs = "i", yaxt =
"n", xlab = "", ylab = "")
text(10.15, 0, "x", pos = 4, xpd = NA, cex = 1.25)
text(0, 11.00, "y", pos = 1.85, xpd = NA, cex = 1.25)
abline(h=3.0, col="red", lwd=1.5)
abline(h=7, col="red", lwd=1.5)
abline(v=5.0, col="gray", lwd=2.0)
abline(v=7, col="gray", lwd=2.0)
segments(0,5, 6,5, lty=2, lwd=2.0)
segments(6,0, 6,5, lty=2, lwd=2.0)
with thanks
steve
-------------------------
Steven M. Stoline
1123 Forest Avenue
Portland, ME 04112
sstoline at gmail.com
[[alternative HTML version deleted]]
More information about the R-sig-teaching
mailing list