Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: make interval_multiples work for years#9841

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 3 commits intomatplotlib:masterfromjklymak:fix-years-autodate
Nov 25, 2017

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedNov 23, 2017
edited
Loading

PR Summary

Ifdates.AutoTickLocator was on the YEARLY frequency, it didn't respect theinterval_multiples kwarg. This changes that by using the YearlyLocator ifinterval_multiples=True

(Of course I still think dateticks should be overhauled, but thats a bigger project)

Fixes#9838

importdatetimeimportmatplotlib.datesasmdatesimportmatplotlib.pyplotaspltimportnumpyasnpx= [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)locator=mdates.AutoDateLocator(interval_multiples=True)ax.xaxis.set_major_locator(locator)plt.show()

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant

@tacaswelltacaswell added this to thev2.2 milestoneNov 23, 2017
@tacaswell
Copy link
Member

👍 in principle. Can you add a test (just setting it up and asking what the ticks are rather than an image test)? Might be worth a whats_new update, or just a callout in the some date-related documentation to make it discoverable.

jklymak reacted with thumbs up emoji

@jklymakjklymak changed the titlemake interval_multiples work for yearsWIP. make interval_multiples work for yearsNov 23, 2017
@jklymak
Copy link
MemberAuthor

@tacaswell I updated the doc at the top (which was out of date, BTW), and also will add to#9827 where I discuss DateLocators.

@jklymakjklymak changed the titleWIP. make interval_multiples work for yearsENH: make interval_multiples work for yearsNov 23, 2017
@tacaswell
Copy link
Member

There is trailing whitespace.

jklymak reacted with thumbs up emoji

@dstansbydstansby merged commit982254c intomatplotlib:masterNov 25, 2017
has2k1 added a commit to has2k1/mizani that referenced this pull requestDec 2, 2017
The restriction in the first place was trying to make upfor what was actually a bug in Matplotlib. It was fixed inmatplotlib/matplotlib#9841.
@QuLogicQuLogic modified the milestones:needs sorting,v2.2.0Feb 12, 2018
@jklymakjklymak deleted the fix-years-autodate branchMarch 5, 2019 16:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v2.2.0
Development

Successfully merging this pull request may close these issues.

YearLocator should prefer ticks at the turn of the decade
4 participants
@jklymak@tacaswell@dstansby@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp