Similarity between bar plots (counts of categories)?

What are the best ways to compare (calculate similarity) between two bar plots? For example:

a = {apple: 2, orange: 10, grape: 1}
b = {apple: 1, cucumber: 2, apricot: 3, avocado: 2}
Similarity (a,b) = ?


I want to compare a and b. The things which come to my mind are Jaccard simlarity and Cross Entropy. Are there any better options?

• You mean clustered barcharts, don't you? – ttnphns Aug 23 '17 at 15:15
• See this answer and other answers there. – ttnphns Aug 23 '17 at 15:26
• I meant: you have 2 vectors length 6 with counts (some counts are 0). Consider it as 2x6 frequency cross-table and compute chi-sq distance or phi-sq distance as explained in the answer I linked to. – ttnphns Aug 23 '17 at 15:30
• @ttnphns, do you think this is a duplicate? – gung Aug 23 '17 at 15:30
• gung, I don't know. That older question is more rich and specific. Maybe a duplicate, maybe not. – ttnphns Aug 23 '17 at 15:32