%pylab inline
import matplotlib as mpl
Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline]. For more information, type 'help(pylab)'.
Define some minor locator to see if the grids draws on minor locator with a linear scale
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
majorLocator = MultipleLocator(100)
majorFormatter = FormatStrFormatter('%d')
minorLocator = MultipleLocator(20)
mpl.rcParams['axes.grid'] = True
fig,(ax1,ax2) = subplots(1,2)
fig.set_figwidth(fig.get_figwidth()*2)
ax2.xaxis.set_major_locator(majorLocator)
ax2.xaxis.set_major_formatter(majorFormatter)
ax2.xaxis.set_minor_locator(minorLocator)
ax2.yaxis.set_major_locator(majorLocator)
ax2.yaxis.set_major_formatter(majorFormatter)
ax2.yaxis.set_minor_locator(minorLocator)
ax1.loglog(range(500),range(500))
ax2.plot(range(500),range(500))
[<matplotlib.lines.Line2D at 0x10bbd4110>]
mpl.rcParams['axes.grid'] = False
fig,(ax1,ax2) = subplots(1,2)
fig.set_figwidth(fig.get_figwidth()*2)
ax1.loglog(range(500),range(500))
ax2.plot(range(500),range(500))
ax2.xaxis.set_major_locator(majorLocator)
ax2.xaxis.set_major_formatter(majorFormatter)
ax2.xaxis.set_minor_locator(minorLocator)
ax1.grid(True)
ax2.grid(True)