I have an array called gender, which stores the number of sales made by males and females. I am trying to create a stacked bar chart of these items but the plot shows the stacked bar chart at 7 on the y axis changing to the next stack which goes up to 14 on the y axis, but should instead go up to 28.
gender = [[7],[14]]
attributes = ("Male & Female")
y_pos = np.arange(len(attributes))
plt.bar(y_pos, gender[0], align='center', alpha=0.5)
plt.bar(y_pos, gender[1], align='center', alpha=0.5)
plt.xticks(y_pos, attributes)
plt.ylabel('Volume')
plt.xlabel('Customer Attributes')
plt.title('Number of Customer Types')
plt.show()

genderis a list of lists, not a 2d-array, moreover I guess you want to define attributes this wayattributes = ("Male", "Female")- Andrea