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
For lack of time the following image wasn't reproduced with the above example, but came from another problem:
The right side shows the problem and the left side is my workaround which calculates some distance for a given amount of labels I want (here I wanted 5 labels or less). So it set every exponent, but every sixth integer exponent, i.e. -16,-10,-4.
It would be cool if it was fully automatic like with linear scales.
2.0 solves the problem for linear scale, but not for log-scale (the original issue): the LogLocator class does not use the ticks-limiting logic present in MaxNLocator. (Apparently neither do SymmetricalLogLocator or LogitLocator.)
@tacaswell : The only difference in 2.0b is that the default label font size is smaller (or maybe it just uses a different backend), resulting in the above linear scale example to actually work. But adding some 0s, I can still reproduce the problem even with linear scales, unlike @anntzer said.
logarithmic scale (minimal example from 1st post):
linear scale (minimal example from 2nd post):
linear scale even more extreme (This may be an extreme example, but it could still be solved by reducing the number of tick labels by one):
Indeed, 2.0 just uses a heuristic where the aspect ratio of an xlabel is no more than 1x3 (by the way, I just realized that this would be way too pessimistic (too optimistic for ylabels) if the labels are rotated...).
As discussed in #5494, it is not so easy to handle this automatically because the tick labels are rendered after the tick positions are selected.
Activity
mxmlnkn commentedon Jun 7, 2016
This bug also happens with the linear scale:
Note that without

tight_layoutthe+1.309e1won't be inside the canvas:I would say this is still another bug.
I would just be nice if the formatter could do something like:
tacaswell commentedon Jun 8, 2016
Can you try the 2.0.0b1 which implements something like that?
anntzer commentedon Jun 8, 2016
2.0 solves the problem for linear scale, but not for log-scale (the original issue): the
LogLocatorclass does not use the ticks-limiting logic present inMaxNLocator. (Apparently neither doSymmetricalLogLocatororLogitLocator.)mxmlnkn commentedon Jun 8, 2016
@tacaswell : The only difference in 2.0b is that the default label font size is smaller (or maybe it just uses a different backend), resulting in the above linear scale example to actually work. But adding some 0s, I can still reproduce the problem even with linear scales, unlike @anntzer said.
logarithmic scale (minimal example from 1st post):



linear scale (minimal example from 2nd post):
linear scale even more extreme (This may be an extreme example, but it could still be solved by reducing the number of tick labels by one):
Above done with:
anntzer commentedon Jun 8, 2016
Indeed, 2.0 just uses a heuristic where the aspect ratio of an xlabel is no more than 1x3 (by the way, I just realized that this would be way too pessimistic (too optimistic for ylabels) if the labels are rotated...).
As discussed in #5494, it is not so easy to handle this automatically because the tick labels are rendered after the tick positions are selected.
tacaswell commentedon Sep 12, 2016
Linked with #7001
ENH: LogLocator can auto-select number of ticks based on axis