I have a dictionary of values (drug) as follows:
{0: {0: 100.0, 1: 0.41249706379061035, 2: 5.144449764434768, 3: 31.078456871927678}, 1: {0: 100.0, 1: 0.6688801420346955, 2: 77.32360971119694, 3: 78.15132480853421}, 2: {0: 100.0, 1: 136.01949766418852, 2: 163.4967732211563, 3: 146.7726208999281}}
It contains 3 drug types, then the efficacy of that drug type in 4 different concentrations.
I'm trying to make a clustered bar chart which compares the 3 drugs against each other like this:
Currently, my code is the following:
fig, ax = plt.subplots()
width = 0.35
ind = np.arange(3)
for x in range(3):
ax.bar(ind + (width * x), drug[x].values(), width, bottom=0)
ax.set_title('Drug efficacy')
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(list(string.ascii_uppercase[0:drugCount]))
ax.autoscale_view()
plt.show()
I have adapted the code from this guide, but am having multiple problems.
I think the main reason is that the data used in the example is such that values in one group correspond to the same colour rather than the same cluster.
How can I adapt this code such that it will plot the efficacy of each drug in the 4 different concentrations in isolation compared to the other drugs?


pd.DataFrame.from_dict(drug_dict, orient='index').plot.bar()?