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
{{ message }}
Repository navigation
[Bug]: LogLocator sometimes draws fewer ticks than it can #29694
Sometimes, LogLocator draws fewer ticks than it can due to less than optimal log stride selection.
Code for reproduction
frompylabimport*# At this figure size there's room for two y ticks# (check with ax.yaxis.get_tick_space())# which could be placed e.g. at 10^0 and 10^4,# but only one tick is drawn at 10^2.figure(figsize=(5, 1)).add_subplot(yscale="log", ylim=(.5, 15000))
Actual outcome
See comment above.
Expected outcome
See comment above.
Additional information
I suspect that the formulas for stride and decades in LogLocator.tick_values() are faulty.
From a quick check: in tick_values() your example has numticks=2 but only one is eventually rendered. When changing to figsize=(5, 1.1), numticks=3 but two are rendered. So yes, there's some logic error in the calculation.
Activity
timhoffm commentedon Mar 1, 2025
From a quick check: in tick_values() your example has
numticks=2but only one is eventually rendered. When changing tofigsize=(5, 1.1),numticks=3but two are rendered. So yes, there's some logic error in the calculation.