Skip to content

Commit 0423ca6

Browse files
committed
Clarify docs of set_powerlimits()
1 parent ecdfa65 commit 0423ca6

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

lib/matplotlib/ticker.py

+19-10
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,28 @@ def set_scientific(self, b):
575575
self._scientific = bool(b)
576576

577577
def set_powerlimits(self, lims):
578-
"""
579-
Sets size thresholds for scientific notation.
578+
r"""
579+
Set size thresholds for scientific notation.
580580
581581
Parameters
582582
----------
583-
lims : (min_exp, max_exp)
584-
A tuple containing the powers of 10 that determine the switchover
585-
threshold. Numbers below ``10**min_exp`` and above ``10**max_exp``
586-
will be displayed in scientific notation.
587-
588-
For example, ``formatter.set_powerlimits((-3, 4))`` sets the
589-
pre-2007 default in which scientific notation is used for
590-
numbers less than 1e-3 or greater than 1e4.
583+
lims : (int, int)
584+
A tuple *(min_exp, max_exp)* containing the powers of 10 that
585+
determine the switchover threshold. For a number representable as
586+
:math:`a \times 10^\mathrm{exp}`` with :math:`1 <= |a| < 10`,
587+
scientific notation will be used if ``exp <= min_exp`` or
588+
``exp >= max_exp``.
589+
590+
In particular numbers with *exp* equal to the thresholds are
591+
written in scientific notation.
592+
593+
Typically, *min_exp* will be negative and *max_exp* will be
594+
positive.
595+
596+
For example, ``formatter.set_powerlimits((-3, 4))`` will provide
597+
the following formatting:
598+
:math:`1 \times 10^{-3}, 9.9 \times 10^{-3}, 0.01,`
599+
:math:`9999, 1 \times 10^4`.
591600
592601
See Also
593602
--------

0 commit comments

Comments
 (0)