Illustration of Grid function:
For illustration, the script below creates two individual figure windows. At First, it clears the figure window. Then, it generates an x vector and two different y vectors (y1 & y2). In the first figure window, it plots the y1 values by using a bar chart. In the next figure window, it plots the y1 values as black lines, place hold on so that the next graph will be superimposed, and plots the y2 values as black o's. Also it puts a legend on this graph and uses a grid. The Labels and titles are absent in this case as it is generic data.