Used matplotlib to plot graph