Create write_x_axis_value function

This allows the x axis values to be written consistently for both stacked and
non-stacked graphs.