how to use matplotlib to plot graph