matplotlib, define size of a grid on a plot
Question: I am plotting using matplotlib in python. I want create plot with grid, here
is an [example](http://www.scipy.org/Plotting_Tutorial) from plotting
tutorial. In my plot range if the y axe is from 0 to 14 and if use
`pylab.grid(True)` then it makes grid with size of square of two, but I want
the size to be 1. How can I force it?


Answer: Try using `ax.grid(True, which='both')` to position your grid lines on both
major and minor ticks, as suggested
[here](http://matplotlib.sourceforge.net/api/axis_api.html).

EDIT: Or just set your ticks manually, like this:

    
    
    import matplotlib.pyplot as plt
    
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot([1,2,3,14],'ro-')
    
    # set your ticks manually
    ax.xaxis.set_ticks([1.,2.,3.,10.])
    ax.grid(True)
    
    plt.show()
    

