act as python code generator and given the data, convert it into the chart using matplotlib.