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

Method get_text

lib/matplotlib/contour.py:254–265  ·  view source on GitHub ↗

Get the text of the label.

(self, lev, fmt)

Source from the content-addressed store, hash-verified

252 .get_window_extent(renderer).width)
253
254 def get_text(self, lev, fmt):
255 """Get the text of the label."""
256 if isinstance(lev, str):
257 return lev
258 elif isinstance(fmt, dict):
259 return fmt.get(lev, '%1.3f')
260 elif callable(getattr(fmt, "format_ticks", None)):
261 return fmt.format_ticks([*self.labelLevelList, lev])[-1]
262 elif callable(fmt):
263 return fmt(lev)
264 else:
265 return fmt % lev
266
267 def locate_label(self, linecontour, labelwidth):
268 """

Callers 2

_get_nth_label_widthMethod · 0.95
add_labelMethod · 0.95

Calls 3

fmtFunction · 0.85
getMethod · 0.45
format_ticksMethod · 0.45

Tested by

no test coverage detected