How to show on a plot minor gridlines with a different thickness?
Assuming I have some data points to plot, say x and y:
import numpy as np
x = np.linspace(0, 1)
y = np.sin(4 * np.pi * x) * np.exp(-5 * x)
I tried plotting them like this:
line(zip(x, y)).show(frame=True, gridlines='minor', axes=False)
In the documentation I read about options for gridlines, including style for vertical and horizontal ones separately, but what about minor and major separation?
What I want is something like this with major lines thicker than minor:
import matplotlib
from matplotlib.pyplot import figure
f = figure(figsize=(8,8))
axes = f.add_axes([.1, .1, .8, .8])
axes.plot(x, y)
axes.grid(True)
axes.get_xaxis().set_minor_locator(matplotlib.ticker.AutoMinorLocator())
axes.get_yaxis().set_minor_locator(matplotlib.ticker.AutoMinorLocator())
axes.grid(b=True, which='minor', linewidth=.2)
axes.grid(b=True, which='major', linewidth=1)
f.savefig('plog.png')