-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Default locator for log-scale messes up minor ticks sometimes #7200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It looks like the problem occurs when the major locator puts ticks at intervals of more than a decade. What should the minor ticks do in that case? I don't see an obvious solution, other than putting minor ticks at the decades when the major ticks are skipping decades. In the upper RHS plot in this example, the minor ticks would be at 10^-9 and 10^-7. |
Would it be a problem if a minor tick was always drawn at any position a major tick is drawn? (We just need to make sure that the major tick is drawn over the minor tick, if both are present.) This would also have avoided (somewhat) issues such as #6875 (comment). |
That would make a mess, or more complexity to avoid the mess, in any case where minor ticks are labeled. |
Good point. |
Would it be possible to decouple label generation from the ticks? There should totally still be major ticks there, but on some of my plots (ylim of 10^-17 to 10^-4) were just way too crowded and ugly. I was in a rush and just posted the first plot that showed it, so maybe not the best example. |
You might be able to shoe-horn some 'return an empty string' logic into |
We've done a lot of work on the ticker module to improve the defaults recently, so it is possible this has been fixed. Do you mind sharing the data and the code so that I can verify we haven't fixed this already? Thanks, |
Not fixed on v2.x: import numpy as np
import matplotlib.pyplot as plt
x = np.logspace(-10, -5, 100)
plt.loglog(x, x)
plt.ylim(2.85e-14, 9.7e-3) |
@efiring Is this still a problem with 2.1.x? Running your snippet, I get However kind of agree with the suggestion that adding an extra unlabelled tick at each decade between the labelled tick might be a good idea. |
I think we can consider the behavior sufficiently improved by #8381 that the original issue is no longer present. Therefore I will close this. |
Thanks for the continuing work guys! |
Ubuntu 16.04 | Python 3.5 | MPL 2.0.0b3.post2474+gf8d05a4
Don't have time to look into this more right now. You can see it gets it right sometimes, but sometimes it is very wrong.
The text was updated successfully, but these errors were encountered: