# Quadstat Output - Bar Plot for Contingency Tables

Submitted by Anonymous (not verified) on May 12, 2019 - 6:30 PM

## Creating the Stacked Barplot

To create a single stacked barplot, we must first isolate the column we wish to plot. In our case, column X.deaths. was chosen. The values in this row include: 785 863 883 793 971 970 751 743 1000 834 775 680 773 916 806 724 743 693 941 926 861.

Now, we will sum these values across the rows, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21, to give us an idea of how far up on the y-axis we will need to go:

785 + 863 + 883 + 793 + 971 + 970 + 751 + 743 + 1000 + 834 + 775 + 680 + 773 + 916 + 806 + 724 + 743 + 693 + 941 + 926 + 861 = 17431.

So we number our y-axis to 17431 as seen in the barplot below. You can make the barplot as wide as you like.

We have a total of 21 rows so we will have 21 partitions. For this part, we will draw partitions at the following point(s): 785 1648 2531 3324 4295 5265 6016 6759 7759 8593 9368 10048 10821 11737 12543 13267 14010 14703 15644 16570. How did we get these point(s)? We sum each value in the X.deaths. column with all the values before it. There are no numbers before the first value, 785, so we just add 0 to it. The second partition would be at 785 + 863 = 1648. We continue until we reach the end of the column.

We then need to choose a color for the bins. This is optional but using a color can help identify partitions. You can see the finished bar plot below with a legend that describes the colors used. We also named the x-axis for the title of the column that we chose, X.deaths.

Image