I am trying to create stack bar chart using matplotlib using following code but the starting and ending point of second part is wrong
import numpy as np
import matplotlib.pyplot as plt
N = 7
m = (5,10,30,40,0,0,0) #(0-5,0-10,26-30,36-40)
w = (15,25,35,0,0,0,0) #(11-15,16-25,31-35)
ind=[5,10 ,15 ,25 ,30,35,40]
# the x locations for the groups
width = 0.55 # the width of the bars: can also be len(x) sequence
p1 = plt.bar(ind, m, width, color='r')
p2 = plt.bar(ind, w, width, color='y',bottom=m)
plt.show()
but #(0-5,0-10,26-30,36-40) #(11-15,16-25,31-35)
bar chart plot on each other but i want first part would be 0 to 5 and second part will be 6 to 15 but it gives 5+15=20 that is wrong i don't want to join it. i mean if first part is 0-5 and second part is 6-15 so that it will show 0-5 and 6-15 not up to 5+15 = 20