Get the profile.c script and check out the plotDay function. Study how it works. You need different parameters for the bar number to plot and for the labels on the x axis.