16.2 Bar plots

A bar chart or bar plot displays rectangular bars with lengths proportional to the values that they represent.

  • A simple bar plot :

  • Customize a bit :
    • col : color
    • main : title of the plot
    • las : orientation of x-axis labels: “2”: perpendicular to axis

  • Customize the ordering of the bars :

By default, the bars are organized in alphabetical order. You can change it with the factors.

  • Let’s make a stacked barplot :

  • Add some parameters: