Skip to content
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

MAINT: Updates to formatters in matplotlib.ticker #6253

Merged
merged 7 commits into from Apr 28, 2016

Conversation

madphysicist
Copy link
Contributor

This PR is a split from #6251. Most of the changes are to docs, but there are two minor code changes:

  1. __all__ has been moved to the top of the file and a couple of missing formatters were added to it.
  2. A second format (position) is permitted in the string for the new-style string formatter.

As the title suggests, only formatters were affected. Locators were left untouched.

I have retained the original commits until the PR is reviewed to make sure that I did the split correctly.

"""
Return a short string version of the tick value.

Defaults to the position-indepedent long value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

independent

@madphysicist madphysicist force-pushed the ticker-formatter-maint branch 2 times, most recently from c07d694 to 7602b04 Compare March 31, 2016 06:21
Switch minor tick labeling on or off.

``labelOnlyBase=True`` to turn off minor ticks.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this currently work? Should it have a not in there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular method I have no idea. The formatter itself seems to work OK though. I will check right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method does nothing for this particular class since self.labelOnlyBase is not used in self.pprint_val. However, it does work for the LogFormatterExponent class, which extends this one. The old docs and the method name are indeed very misleading. labelOnlyBase is named correctly (as I have noted in the updated docs). If it is True, minor ticks will not be shown, which is exactly the opposite of what the name of the method implies. I did not find any explicit calls to this method in matplotlib. Am I free to modify the parameter name to say labelMinor and set self.labelOnlyBase = not labelMinor?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but can you do that in a separate PR? The doc updates are non-controversial and should go in, but the API change should get more attention.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have opened up #6264 with the code change.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.0 (style change major release) Apr 2, 2016
@tacaswell
Copy link
Member

This looks good, but needs a rebase 😞 \

madphysicist and others added 7 commits April 11, 2016 16:28
@madphysicist
Copy link
Contributor Author

Fixed. I've been spoiled by Homu on numpy.

@tacaswell tacaswell merged commit 8658721 into matplotlib:master Apr 28, 2016
tacaswell added a commit that referenced this pull request Apr 28, 2016
MAINT: Updates to formatters in `matplotlib.ticker`
Conflicts:
	.mailmap
	  - just added the 1 new line, did not change any others
	lib/matplotlib/tests/test_ticker.py
	  - whitespace vs new tests
@tacaswell
Copy link
Member

backported to v2.x as 668f292

@madphysicist madphysicist deleted the ticker-formatter-maint branch May 1, 2016 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants