Reputation: 173
I have this barplot and changing with width value is only changing the width of the very last bar. I've attached the picture and code. Anyone know why?
indexes = np.arange(len(labels))
width = 2
pdb.set_trace()
plt.bar(indexes, values, width=2, color="blueviolet")
plt.xlabel("Phenotype identifier", fontdict=font)
Upvotes: 2
Views: 1105
Reputation: 54330
Because your bars over laps with each other and your data happens to be monotonically increasing, see, if you (suppose indexes=range(10)
):
plt.bar(indexes, range(10)[::-1], width=2, color="blueviolet") #indexes should be indices
you'll get:
Upvotes: 3