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

Method get_offset

lib/matplotlib/ticker.py:1530–1548  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1528 # offset, self._orderOfMagnitude is consulted. This behavior is verified
1529 # in `test_ticker.py`.
1530 def get_offset(self):
1531 # docstring inherited
1532 if len(self._locs) == 0:
1533 return ''
1534 if self.offset:
1535 offsetStr = ''
1536 if self.offset:
1537 offsetStr = self.format_data(self.offset)
1538 if self.offset > 0:
1539 offsetStr = '+' + offsetStr
1540 sciNotStr = self.format_data(10 ** self._orderOfMagnitude)
1541 if self._useMathText or self._usetex:
1542 if sciNotStr != '':
1543 sciNotStr = r'\times%s' % sciNotStr
1544 s = f'${sciNotStr}{offsetStr}$'
1545 else:
1546 s = sciNotStr + offsetStr
1547 return self.fix_minus(s)
1548 return ''
1549
1550 def format_eng(self, num):
1551 """Alias to EngFormatter.format_data"""

Callers 1

Calls 2

format_dataMethod · 0.95
fix_minusMethod · 0.80

Tested by 1