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

Method get_offset

lib/matplotlib/ticker.py:768–793  ·  view source on GitHub ↗

Return scientific notation, plus offset.

(self)

Source from the content-addressed store, hash-verified

766 return f"{significand}e{exponent}"
767
768 def get_offset(self):
769 """
770 Return scientific notation, plus offset.
771 """
772 if len(self._locs) == 0:
773 return ''
774 if self._orderOfMagnitude or self.offset:
775 offsetStr = ''
776 sciNotStr = ''
777 if self.offset:
778 offsetStr = self.format_data(self.offset)
779 if self.offset > 0:
780 offsetStr = '+' + offsetStr
781 if self._orderOfMagnitude:
782 if self._usetex or self._useMathText:
783 sciNotStr = self.format_data(10 ** self._orderOfMagnitude)
784 else:
785 sciNotStr = '1e%d' % self._orderOfMagnitude
786 if self._useMathText or self._usetex:
787 if sciNotStr != '':
788 sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
789 s = fr'${sciNotStr}\mathdefault{{{offsetStr}}}$'
790 else:
791 s = ''.join((sciNotStr, offsetStr))
792 return self.fix_minus(s)
793 return ''
794
795 def set_locs(self, locs):
796 # docstring inherited

Callers

nothing calls this directly

Calls 3

format_dataMethod · 0.95
joinMethod · 0.80
fix_minusMethod · 0.80

Tested by

no test coverage detected