I am trying to plot a barplot using matplotlib with different gap sizes between the bars. I have been reading other posts, but mostly I found that only changing the bar width helps. I was hoping for a different solution.
I have 5 locations with 3 bars each I want to show. That makes 15 bars in total. For each of the locations I am trying to have one tick on the x-Axis with 3 bars without any space in between them. But from those three bars to the next location with 3 bars, I need to have some space in between. I hope you get what I am trying to say.
plt.bar('A', Data_A, width = 0.5, color='navy', label='A')
plt.bar('B', Data_B, width = 0.5, color='mediumblue', label='B')
plt.bar('C', Data_C, width = 0.5, color='brown', label='C')
plt.bar('D', Data_D, width = 0.5, color='darkred', label='D')
plt.bar('E', Data_E, width = 0.5, color='salmon', label='E')
plt.ylabel('RMSE[%]')
#plt.legend(bbox_to_anchor=(0.04, 1.2), loc='upper left', ncol=3)
#plt.savefig('Pearson'+name+'.png')
plt.show()
This is what I used so far, but now I want to exchange each bar with 3 more specific bars, which will make the whole thing very chaotic, if I cant change the gapsize.
Is there a simple way of setting the gapsize between the bars, even if they are all the same width?