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

Implements WilkinsonLocator using Extended Wilkinson Algorithm#30632

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

Open
evhalp wants to merge8 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromevhalp:WilkinsonLocator-issue-#9373

Conversation

evhalp
Copy link

PR summary

This pull request responds to Issue#9373 by implementing a new tick locator based on Talbot, Lin, and Hanrahan's extended Wilkinson tick-placing algorithm. It's primary method of tick placement relies on balancing four main criteria:

  1. Simplicity: biases tick location in favor of round numbers
  2. Coverage: biases tick locations in favor of completely covering the provided data range
  3. Density: biases tick number towards matching provided target number of ticks
  4. Legibility: biases tick formatting in favor of readability

While this implementation could be improved upon (for example, by making the legibility score change the formatting of the graphics, etc.), I think this serves as a good jumping off point for anyone who wants to expand it.

The primary benefits of including this tick locator would be its ease of customizability. By simply changing number of ticks, step preferences, and weights of the four main criteria, the user can tune this locator in any method they please, allowing easy customization without taking away ease of understanding.

Here's an example of the tick locator in action:

importmatplotlib.pyplotaspltimportmatplpotlib.tickerastickerfig,ax=plt.subplots()ax.plot([0,10], [0,10])ax.xaxis.set_major_locator(ticker.WilkinsonLocator(target_ticks=5))ax.yaxis.set_major_locator(ticker.WilkinsonLocator(target_ticks=5))plt.show()

Let me know if you need anything else!

PR checklist

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@evhalp

[8]ページ先頭

©2009-2025 Movatter.jp