An example of use how the plot_square function can be used to plot several squares. Then text is put inside one of these squares.

> source("lab4-fun.r")                           # Read the function definition
> plot (c(), xlim=c(-1,7), ylim=c(-1,5), asp=1)  # Create an empty plot
> plot_square(0,0)                               # Plot some squares
> plot_square(3,1,col="red")
> plot_square(5,4,lwd=3,size=1.5)
> plot_square(0.5,3.8,size=2,lwd=2,col="green")
> text(0.5,3.8,"The last one!")                  # Put text in the last square

plot of chunk unnamed-chunk-2

That's all there is…