Not equal minor ticks for all major ticks on log-scaled y-axis

Hi!

When yscale is set to log, the lowest value tick on the y-axis does not have as many minor ticks shown as the other major y-ticks. Why is that and how can I ensure that they do? For example, this code produces 7 minor ticks for 10^-4 and 8 minor ticks for 10^-3, by default.

fig, ax = plt.subplots()


x = np.linspace(0.1, 10, 100)
y = np.exp(-x)

ax.plot(x, y)
ax.set_yscale('log')

plt.show()

plot_example

Matplotlib chooses automatic limits for the y-axis based on your data range plus a small margin. In this case the lower y-axis limit is just below 3e-5. You can set the limit manually, e.g.

ax.set_ylim(bottom=1e-5)