Say we have two datasets below:
data1 = {
'A' : pd.Series([10, 20, 30, 40], index = [1, 2, 3, 4]),
'B' : pd.Series([8, 15, 29, 42], index = [1, 2, 3, 4]),
'C' : pd.Series([7, 13, 31, 45], index = [1, 2, 3, 4])
}
data2 = {
'A' : pd.Series([9, 18, 27, 38], index = [1, 2, 3, 4]),
'B' : pd.Series([11, 17, 28, 41], index = [1, 2, 3, 4]),
'C' : pd.Series([12, 17, 29, 42], index = [1, 2, 3, 4])
}
I can represent the data1
using a grouped bar chart, where the x-axis is have ticks [1, 2, 3, 4]. Within each tick, I can have three sections 'A', 'B' and 'C' and I can form barchart with the values in the dataset. A generic example of a grouped bar chart is
.
I can also form a similar group bar chart for data2
.
Is there a way that I can combine these two group charts in a single plot? Is there any other kind of chart that can be used to represent both data1
and data2
in a single plot?
Thanks