If you want to use the Loyola University of Chicago grid, you can just download it and use it as your grid input. Otherwise, it should be easy to see how to modify this file to suit your purposes. Each row of the file begins with a string of day codes; after that you can have however many fields you want that specify a time (in 24 hour format) that will be used to draw a dotted line in the plot under the relevant days. In the Loyola grid sample, two times were placed in each row to indicate standard start and end times for classes, but you could use one time per row or even put all the MWF times in one row and all the TR times in a second row.
Here are two other prepared grids that you may be able to use as is:
Note that the earliest and latest times in your grid will be used to scale your plot to fit on one page. To get a nice plot, you should not have courses that fall outside of the range of times in your grid, nor should the range in your grid be vastly larger than the time range actually used by your courses.