MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_powerlimits

Method set_powerlimits

lib/matplotlib/ticker.py:690–722  ·  view source on GitHub ↗

r""" Set size thresholds for scientific notation. Parameters ---------- 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 \tim

(self, lims)

Source from the content-addressed store, hash-verified

688 self._scientific = bool(b)
689
690 def set_powerlimits(self, lims):
691 r"""
692 Set size thresholds for scientific notation.
693
694 Parameters
695 ----------
696 lims : (int, int)
697 A tuple *(min_exp, max_exp)* containing the powers of 10 that
698 determine the switchover threshold. For a number representable as
699 :math:`a \times 10^\mathrm{exp}` with :math:`1 <= |a| < 10`,
700 scientific notation will be used if ``exp <= min_exp`` or
701 ``exp >= max_exp``.
702
703 The default limits are controlled by :rc:`axes.formatter.limits`.
704
705 In particular numbers with *exp* equal to the thresholds are
706 written in scientific notation.
707
708 Typically, *min_exp* will be negative and *max_exp* will be
709 positive.
710
711 For example, ``formatter.set_powerlimits((-3, 4))`` will provide
712 the following formatting:
713 :math:`1 \times 10^{-3}, 9.9 \times 10^{-3}, 0.01,`
714 :math:`9999, 1 \times 10^4`.
715
716 See Also
717 --------
718 ScalarFormatter.set_scientific
719 """
720 if len(lims) != 2:
721 raise ValueError("'lims' must be a sequence of length 2")
722 self._powerlimits = lims
723
724 def format_data_short(self, value):
725 # docstring inherited

Callers 3

test_scilimitsMethod · 0.95
test_ticklabel_formatFunction · 0.80
ticklabel_formatMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_scilimitsMethod · 0.76
test_ticklabel_formatFunction · 0.64