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

Method _get_rendered_text_width

lib/matplotlib/text.py:778–787  ·  view source on GitHub ↗

Return the width of a given text string, in pixels.

(self, text)

Source from the content-addressed store, hash-verified

776 return min(h1, h2)
777
778 def _get_rendered_text_width(self, text):
779 """
780 Return the width of a given text string, in pixels.
781 """
782
783 w, h, d = _get_text_metrics_with_cache(
784 self._renderer, text, self.get_fontproperties(),
785 cbook.is_math_text(text),
786 self.get_figure(root=True).dpi)
787 return math.ceil(w)
788
789 def _get_wrapped_text(self):
790 """

Callers 1

_get_wrapped_textMethod · 0.95

Calls 3

get_fontpropertiesMethod · 0.95
get_figureMethod · 0.45

Tested by

no test coverage detected