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
Currently, when setting xlim(1231, 1239), the offset text is "+1.231e3" and the x labels are 0, ..., 8. I would suggest switching this to +1230 and x labels being 1, ..., 9. There is a formatting issue (basically using "%g" instead of "%f"), but I want to concentrate here on the actual value of the offset.
Basically, I think a reasonable algorithm for the choice of the offset value is the following:
(1) if xmin and xmax have the same number of digits: use the longest common prefix of their string representations, padded by zeros (e.g. xyzabc .. xyzdef => xyz000).
(2) if they don't have the same number of digits (e.g. 9995 .. 10005), I see two possibilities: either fall back to using 9995 as base offset, or use 10000 as base offset in which case the x labels will go from -5 to +5. I tend to think the second option is better but it is true that negative labels can look weird.
(3) note that using negative labels is also an option in case (1) if the number of zeros in the padding is "large" relative to the x range, e.g. 12399995 .. 12400005: it may be better to use 12400000 as base offset and have x labels from -5 to +5 rather than 12300000 as base offset and have x labels from 99995 to 100005.
Activity
mdboom commentedon Dec 29, 2015
This is a long-standing problem, and as you point out in #5738 is now going to be much more prevalent.
As for thoughts, I guess it might be useful to make a draft PR that we could all kick at and see how it helps in various contexts.
tacaswell commentedon Jan 1, 2016
Note of promise of test against #5780
Better choice of offset-text.
Better choice of offset-text.
Better choice of offset-text.
Better choice of offset-text.
Better choice of offset-text.
Better choice of offset-text.
Better choice of offset-text.
anntzer commentedon May 11, 2016
Closed by #5785.