-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Number of ticks for dates still gives overlapping labels #7712
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
The AutoDateLocator uses a completely different mechanism to set the default max number of ticks. It has an internal table of max numbers depending on the unit of time it is working with, and there is no consideration of the physical size of the axis or of the font size. You can supply a max that overrides the default. You can also slant the tick labels as in http://matplotlib.org/devdocs/examples/api/date_demo.html. I think that there is considerable room for improvement in the way we handle datetime ticking and labeling, but it needs to be left as a project for after the v2.0 release. |
I would like to work on the issue. Where should I start with this? |
How did you get the daily interval to be every 6 days? If you look at the value of DAILY inside the self.intervald dictionary, the intervals can within a month can only be every 1, 2, 3, 7, 14, or 12 days because DAILY: [1,2,3,7,14,21]. So shouldn't the interval be either 1, 2, 3, 7, 14, and 21 and not 6? Please, correct me if I'm wrong. |
Yeah, I was playing around with differing minticks and intervals as well |
I'm going to close this as partially obviated by #10841. That new formatter is not the default, but does give the user a way to have more compact date labels. In general, its going to be hard to make tick locating depend on tick formatting. |
Matplotlib 2.0 introduced better default tick locators to have a better (often less) number of ticks (http://matplotlib.org/devdocs/users/dflt_style_changes.html#number-of-ticks) that prevents overlap of ticklabels. Which is a really nice enhancement, only it seems that this enhancement is not working for datetime tick labels:
This still gives the 'too much' tick labels like before (actually, the same plot but with integer x values gives fewer ticks).
Is there a technical reason for this? (the
DateLocator
using another mechanism to determine the number of ticks as the defaultAutoLocator
)Matplotlib 2.0.0rc2 (installed from conda-forge)
The text was updated successfully, but these errors were encountered: