added grid and legend to the plotter