I am not an expert on visualization, but it appears to me that the information conveyed by the two types of charts are the same -- the conditional distribution $Y \mid X$ and the marginal distribution of $X$ (in the case of a spineplot the widths denote the marginal distribution of $X$ and in the case of the absolute stacked bar chart, it is the height of the bars). Is there information that one shows that the other does not contain? Is there reason to prefer one or the other to visualize the joint distribution of two categorical variables?

As an illustration, here is a spineplot and a stacked bar chart with the same data:

enter image description here

enter image description here

The code to produce these charts is here -- I was not able to find a better way to produce a spineplot in R using ggplot2.


1 Answer 1


You're right, they contain the same information, just represented different ways. Vertically, within each bar, they represent the conditional proportions of the different var2 categories. The second piece of information is the amount of data in each of the var1 categories.

They make different comparisons easier or harder. The stacked bar chart displays the absolute counts. It is easier to determine what the marginal counts for the different levels of var1 in the stacked bar chart because you can just read that information off of the top of the bar. It is likewise easy to read off the absolute counts for the first category (a) of var2 within each category of var1. Because the subsequent categories have their beginnings / bottoms at different levels, it is harder to read the absolute counts for them, but you can still get a sense of the relative proportions.

For the splineplot, the absolute counts are masked from the viewer. Without independent information about the total, the counts cannot even be estimated from the figure. On the other hand, it is easier to get a sense of the proportions of the total made up by each category in var1 by simply looking at how wide they are. In addition, the spineplot makes it easier to compare the conditional proportions of var2 between the different categories of var1.

As in many things, which is 'better' depends on what your goals are. Because I suspect comparing relative conditional proportions is a much more common task in data exploration, I think the spineplot will typically be more useful.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.