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

Method set_useOffset

lib/matplotlib/ticker.py:551–583  ·  view source on GitHub ↗

Set whether to use offset notation. When formatting a set numbers whose value is large compared to their range, the formatter can separate an additive constant. This can shorten the formatted numbers so that they are less likely to overlap when drawn on an a

(self, val)

Source from the content-addressed store, hash-verified

549 return self._useOffset
550
551 def set_useOffset(self, val):
552 """
553 Set whether to use offset notation.
554
555 When formatting a set numbers whose value is large compared to their
556 range, the formatter can separate an additive constant. This can
557 shorten the formatted numbers so that they are less likely to overlap
558 when drawn on an axis.
559
560 Parameters
561 ----------
562 val : bool or float
563 - If False, do not use offset notation.
564 - If True (=automatic mode), use offset notation if it can make
565 the residual numbers significantly shorter. The exact behavior
566 is controlled by :rc:`axes.formatter.offset_threshold`.
567 - If a number, force an offset of the given value.
568
569 Examples
570 --------
571 With active offset notation, the values
572
573 ``100_000, 100_002, 100_004, 100_006, 100_008``
574
575 will be formatted as ``0, 2, 4, 6, 8`` plus an offset ``+1e5``, which
576 is written to the edge of the axis.
577 """
578 if isinstance(val, bool):
579 self.offset = 0
580 self._useOffset = val
581 else:
582 self._useOffset = False
583 self.offset = val
584
585 useOffset = property(fget=get_useOffset, fset=set_useOffset)
586

Callers 7

__init__Method · 0.95
test_ticklabel_formatFunction · 0.80
__init__Method · 0.80
ticklabel_formatMethod · 0.80

Calls

no outgoing calls

Tested by 4

test_ticklabel_formatFunction · 0.64