from http://www.scipy-lectures.org/intro/matplotlib/auto_examples/plot_grid.html
Displaying a grid on the axes in matploblib.

import matplotlib.pyplot as plt ax = plt.axes([0.025, 0.025, 0.95, 0.95]) #[xmin,ymin,xmax,ymax] ax.set_xlim(0,</