You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there is already an issue about this somewhere around (which I can't find currently).
For some (maybe desired?) reason, minor ticks are labelled as well, depending on the axis bounds.
A workaround is to turn them off.
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
s = 10
ax.axis([s, 100, 10, 100])
ax.loglog([20, 30], [30, 40])
from matplotlib.ticker import ScalarFormatter, NullFormatter
for axis in [ax.xaxis, ax.yaxis]:
axis.set_major_formatter(ScalarFormatter())
axis.set_minor_formatter(NullFormatter())
ax.set_xticks([20, 55])
ax.set_yticks([20, 55])
plt.show()
Activity
ImportanceOfBeingErnest commentedon Jul 5, 2018
I think there is already an issue about this somewhere around (which I can't find currently).
For some (maybe desired?) reason, minor ticks are labelled as well, depending on the axis bounds.
A workaround is to turn them off.
tacaswell commentedon Jul 5, 2018
See https://matplotlib.org/users/dflt_style_changes.html#logformatter-labeling-of-minor-ticks
The underlying issue is we made the defaults better, but did so in a way that broke people's existing work-arounds.
timhoffm commentedon Jan 28, 2019
Related: #13112, #13126.