Q:

Plot multiple rectangles

I am a real dummy in R. Could you please explain me how to plot multiple rectangles as in example plot below, by using rect?
Thank you!

A:

plot(c(0, 100), c(0, 100), type = "n", axes = FALSE, xlab = "", ylab = "")
rect(10, 10, 90, seq(10, 90, 1), border = "lightgray", lwd = 3)

