Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH ticks sublabel display is now an option #7438

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

Merged
merged 15 commits into from
Dec 1, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix docstring; validate subs
  • Loading branch information
efiring committed Nov 25, 2016
commit ecc62126e1dc2005dc47e1f8245628d58522b4cc
12 changes: 7 additions & 5 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,8 @@ def label_minor(self, labelOnlyBase):

Parameters
----------
labelOnlyBase : bool, optional, default: True
If true, label ticks only at integer powers of base.
labelOnlyBase : bool
If True, label ticks only at integer powers of base.

"""
self.labelOnlyBase = labelOnlyBase
Expand Down Expand Up @@ -1908,7 +1908,9 @@ def subs(self, subs):
if subs is None: # consistency with previous bad API
self._subs = 'auto'
elif cbook.is_string_like(subs):
# TODO: validation ('all', 'auto')
if subs not in ('all', 'auto'):
raise ValueError("A subs string must be 'all' or 'auto'; "
"found '%s'." % subs)
self._subs = subs
else:
self._subs = np.asarray(subs, dtype=float)
Expand Down Expand Up @@ -2045,8 +2047,8 @@ def __init__(self, transform=None, subs=None, linthresh=None, base=None):
self._base = base
self._linthresh = linthresh
else:
raise ValueError("Either transform or linthresh "
"and base must be provided.")
raise ValueError("Either transform, or both linthresh "
"and base, must be provided.")
if subs is None:
self._subs = [1.0]
else:
Expand Down