Why does axis.grid: True in matplotlibrc prevents proper grid with narrow log axis

Hi all. When my matplotlibrc contains

axes.grid : True

Then the following plot does not show a grid:

from matplotlib import pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
x = np.geomspace(0.001,5,101)
y = 10**(-0.2-0.05*(np.log10(x)+0.5)**2)
ax = plt.gca()
yticks = [0.2,0.3,0.4,0.5,0.6] # should not need to be set!
ax.yaxis.set_major_locator(ticker.FixedLocator(yticks)) # why so complicated?

I find this lack of grid, quite puzzling.

But if I remove the line from my matplotlibrc, then the plot comes out with the proper grid. Is there a way to keep axes.grid : True in my matplotlibrc and be able to see the grid? For example


does not show the grid (with the line in my matplotlibrc).

I also added comments to complain that setting ticks in matplotlib is more complicated than in other plotting languages. For one, if the log axis has a narrow range, matplotlib should default to choosing major ticks that are not decades.