Using MatPlotLib in Python, i have tried this:
labels = range(len(df["Investigations"])) #column vector of strings - hid for the example's sake
normals = df["No signs of pathology"] #column vector of integers
abnormals = df["Abnormal"] #column vector of integers
width = 0.5
fig, ax = plt.subplots()
#set size
fig.set_figheight(7.5)
#labels
ax.barh(labels, normals, width, label='No signs of pathology', color='blue')
ax.barh(labels, abnormals, width, label='Abnormal', color='red')
# grid lines
ax.set_axisbelow(True)
ax.xaxis.grid(color='gray', linestyle='solid', alpha=0.2)
#read top-to-bottom
#Title and legend
ax.set_title('Investigations')
ax.legend(loc='upper center', bbox_to_anchor=(0.5, -0.05),
fancybox=True, shadow=True, ncol=5)
plt.show()
This gives me a chart that looks like the attachement, but i can see that the red, and the blue bars does not stack but overlaps. They should be stacking. Can anyone help me solve this issue? :)