I am new to Python and I need to generate bar chart using pyplot and matplotlib. So far i tried like this (I have attached only the important code snippet):
import matplotlib.pyplot as plt
import numpy as np
finalDataset=[finalAverage,final4Average]
N=len(finalDataset)
ind=np.arange(N)
width=0.45
rects1=plt.bar(ind,finalDataset,width,color='blue')
plt.xticks(ind+width/2,("A","B"))
plt.ylabel('y-axis')
plt.xlabel('x-axis')
plt.savefig("sample.png")
But my problem is I need output like this (Expected output) :

