FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Clarify docs of set_powerlimits() by timhoffm · Pull Request #17590 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
31 changes: 21 additions & 10 deletions lib/matplotlib/ticker.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -653,19 +653,30 @@ def set_scientific(self, b):
self._scientific = bool(b)

def set_powerlimits(self, lims):
"""
Sets size thresholds for scientific notation.
r"""
Set size thresholds for scientific notation.

Parameters
----------
lims : (min_exp, max_exp)
A tuple containing the powers of 10 that determine the switchover
threshold. Numbers below ``10**min_exp`` and above ``10**max_exp``
will be displayed in scientific notation.

For example, ``formatter.set_powerlimits((-3, 4))`` sets the
pre-2007 default in which scientific notation is used for
numbers less than 1e-3 or greater than 1e4.
lims : (int, int)
A tuple *(min_exp, max_exp)* containing the powers of 10 that
determine the switchover threshold. For a number representable as
:math:`a \times 10^\mathrm{exp}`` with :math:`1 <= |a| < 10`,
scientific notation will be used if ``exp <= min_exp`` or
``exp >= max_exp``.

The default limits are controlled by :rc:`axes.formatter.limits`.

In particular numbers with *exp* equal to the thresholds are
written in scientific notation.

Typically, *min_exp* will be negative and *max_exp* will be
positive.

For example, ``formatter.set_powerlimits((-3, 4))`` will provide
the following formatting:
:math:`1 \times 10^{-3}, 9.9 \times 10^{-3}, 0.01,`
:math:`9999, 1 \times 10^4`.

See Also
--------
Expand Down

Back | FazBrowse Home | New Git URL