16.4 Box plots

A boxplot is a convenient way to describe the distribution of the data.

  • A simple boxplot:

  • Add some arguments :
    • xlab: x-axis label
    • ylab: y-axis label
    • at: position of each box along the x-axis: here we skip position 3 to allow more space between boxes 1/2 and 3/4

  • Add an horizontal line at y=0 with abline(); arguments of abline :
    • h : y-axis starting point of horizontal line (v for a vertical line)
    • col : color
    • lwd : line thickness
    • lty : line type

  • Line types in R: