I am plotting using Matplotlib in Python. I want create plot with grid, and here is an example from a plotting tutorial. In my plot range if the y axis is from 0 to 14 and if I use pylab.grid(True) then it makes a grid with the size of square of two, but I want the size to be 1. How can I force it?
I am plotting using Matplotlib in Python. I want create plot with grid, and
Share
Try using
ax.grid(True, which='both')to position your grid lines on both major and minor ticks, as suggested here.EDIT: Or just set your ticks manually, like this: