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

Method fix_minus

lib/matplotlib/ticker.py:301–310  ·  view source on GitHub ↗

Some classes may want to replace a hyphen for minus with the proper Unicode symbol (U+2212) for typographical correctness. This is a helper method to perform such a replacement when it is enabled via :rc:`axes.unicode_minus`.

(s)

Source from the content-addressed store, hash-verified

299
300 @staticmethod
301 def fix_minus(s):
302 """
303 Some classes may want to replace a hyphen for minus with the proper
304 Unicode symbol (U+2212) for typographical correctness. This is a
305 helper method to perform such a replacement when it is enabled via
306 :rc:`axes.unicode_minus`.
307 """
308 return (s.replace('-', '\N{MINUS SIGN}')
309 if mpl.rcParams['axes.unicode_minus']
310 else s)
311
312 def _set_locator(self, locator):
313 """Subclasses may want to override this to set a locator."""

Callers 7

format_fieldMethod · 0.80
get_offsetMethod · 0.80
__call__Method · 0.80
__call__Method · 0.80
get_offsetMethod · 0.80
__call__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected