Dear All,
I want to keep the width of the bars the same no matter the number of bars compared is high or low. I am using Matplotlib stacked bar chart. the width of the bars is relative to the number of the bars. Here is my sample code.
How can I make the width the same no matter the number of bars I compare from 1 to 10
import numpy as np
import matplotlib.pyplot as plt
N =1
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars: can also be len(x) sequence
design = []
arch = []
code = []
fig = plt.figure()
b = [70]
a= np.array([73])
c = [66]
p1 = plt.bar(ind, a,width, color='#263F6A')
p2 = plt.bar(ind, b, width, color='#3F9AC9', bottom=a)
p3 = plt.bar(ind, c, width, color='#76787A', bottom=a+b)
plt.ylabel('Scores')
plt.title('CQI Index')
plt.xticks(ind+width/2., ('P1'))#dynamic - fed
plt.yticks(np.arange(0,300,15))
plt.legend( (p1[0], p2[0], p3[0]), ('A','B','C') )
plt.grid(True)
plt.show()
Thank you