Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site



Just a note

Notice that, with this type of graph, it is relatively easy to compare the overall heights of the bars, and the relative contribution of the bottom-most subclass (in this case shown in green). It is rather less easy to compare the contribution of other subclasses - in this case the males.

The following code produces much the same sort of result using R


  • The function barplot is not really meant for plotting distributions of discrete (measurement) variables - it is meant for nominal variables. As such it is rather inflexible. Ideally one would reduce the width of the bars so they were not touching, but this can only be done by increasing the width of the whole plot and giving values for x lim.
  • Alternatively, you could simply plot a 'high-density plot', as in the left-hand graph.