Skip to content

Minor ticks not working properly with logscale

Summary

When using logscale on a plot, the minor ticks do not show up on the corresponding axis.

In my case it works after by just commenting out this line:

axes.yaxis.set_minor_locator(AutoMinorLocator())

However, then linscale plots are not properly ticked.

Steps to reproduce

test script atlasify_test.py

import atlasify
from matplotlib.figure import Figure
import numpy as np


x = np.linspace(0, 5, 100)
y = np.exp(-x)

fig = Figure()
ax = fig.add_subplot()
ax.plot(x, y)
ax.set_yscale("log")

atlasify.atlasify(axes=ax)

fig.savefig("plots/atlasify_test.png")

Resulting console output

atlasify_test.py:16: UserWarning: AutoMinorLocator does not work with logarithmic scale
  fig.savefig("plots/atlasify_test.png")

Resulting plot

atlasify_test

What is the expected correct behavior?

Expected plot (with minor ticks on y-axis).

atlasify_test

Edited by Joschka Birk