I am currently using matplotlib.pyplot to create graphs and would like to have the major gridlines solid and black and the minor ones either greyed or dashed.
In the grid properties, which=both/major/mine, and then color and linestyle are defined simply by linestyle. Is there a way to specify minor linestyle only?
The appropriate code I have so far is
plt.plot(current, counts, 'rd', markersize=8)
plt.yscale('log')
plt.grid(b=True, which='both', color='0.65', linestyle='-')
Actually, it is as simple as setting
majorandminorseparately:The gotcha with minor grids is that you have to have minor tick marks turned on too. In the above code this is done by
yscale('log'), but it can also be done withplt.minorticks_on().