# Comparing Two Bar Charts

Imagine two bar charts with x-axis of 1,2,3,4. The first has 2,4,2,4 as the height for each container ( ie there are 2 1s, 4 2s etc). The second has has 6,12,6,12. I want a percentage from 0 to 100% of how closely the first one matches the second (in essentially being a kind of subset). In this example, it would be 100%. Say we had a third of 6,11,6,12. I would want that percentage to be the ~80% or 90%s wherever it may lie. Is this possible?

• Please explain the criterion you are using to "match" a chart. Could one reorder the bars in one chart, for instance? Must the bars all have positive nonzero heights? Must they always be whole numbers? What do the heights represent? What do you mean by "subset"? And what exactly is a number like 80% supposed to measure? – whuber Feb 24 '17 at 0:56
• No reordering the bars, The bars will be 0 or positive, never negative. They will always be whole numbers. The heights represent the number of times a number( such a 1 occurs in the dataset) By subset, I mean that the latter boxplot will be the original plus some newer data. The 80% is supposed to be an indicator of how closely the the latter dataset represents the earlier dataset. – FamousFrik Feb 24 '17 at 1:22
• That clarifies much of your question. But since there are infinitely many ways to measure "closeness," could you articulate what your measure is intended to represent? What is the purpose of this exercise? – whuber Feb 24 '17 at 14:16
• To come to some conclusion on how matching in shape two bar charts or rather two discrete probability distributions are. – FamousFrik Feb 24 '17 at 15:21
• That's too vague to allow any kind of objective response: what kind of conclusion, exactly? In what sense should the "shapes" be measured and "matched"? – whuber Feb 24 '17 at 16:05