Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug summary
YearLocator
is agnostic about decades. Ticks at the decades are nicer, so when choosing a starting value in some cases it should prefer to start a the turn of the decade or even mid decade. i.e 1970 instead of 1968, 1965 instead of 1964. This "smart" behaviour should apply when the intervals are factors of 5 and 10.
Code for reproduction
importdatetimeimportmatplotlib.pyplotaspltx= [datetime.datetime(1966,1,1),datetime.datetime(2017,1,1)]ticks= [datetime.datetime(i,1,1)foriinrange(1970,2020,10)]y=np.arange(len(x))fig,ax=plt.subplots()ax.plot_date(x,y)# ax.set_xticks(ticks) # preferred ticks
Metadata
Metadata
Assignees
Labels
No labels