I am trying to display a stacked bar graph.I have 3 lists as shown below-
totalpointperxaxis [6, 9, 13, 5, 14, 382, 26, 2, 45, 2]
clusternamesList [['Cluster1', 'Cluster2'], ['Cluster1', 'Cluster3'], ['Cluster2', 'Cluster4'], ['Cluster1', 'Cluster3'], ['Cluster2', 'Cluster5'], ['Cluster3', 'Cluster6', 'Cluster7'], ['Cluster2', 'Cluster4', 'Cluster6', 'Cluster7'], ['Cluster1', 'Cluster3'], ['Cluster1', 'Cluster2', 'Cluster4', 'Cluster5', 'Cluster6'], ['Cluster1', 'Cluster3']]
ppclusterList [[1, 5], [4, 5], [12, 1], [1, 4], [13, 1], [6, 173, 203], [21, 2, 1, 2], [1, 1], [2, 34, 2, 6, 1], [1, 1]]
Here, "totalpointperxaxis" would define the heights of each bar "ppcluster" (pointspercluster) , would be part of each of these bars, colour coordinated according to the cluster name. The number of clusters is not known before hand and the list may change when i add more data points.
As you can see, each list has 10 sublists. The idea is to display a stacked bar graph as seen in this example enter image description here