MCPcopy
hub / github.com/matplotlib/matplotlib / get_text_bounds

Method get_text_bounds

lib/matplotlib/table.py:167–173  ·  view source on GitHub ↗

Return the text bounds as *(x, y, width, height)* in table coordinates.

(self, renderer)

Source from the content-addressed store, hash-verified

165 self._text.set_position((x, y))
166
167 def get_text_bounds(self, renderer):
168 """
169 Return the text bounds as *(x, y, width, height)* in table coordinates.
170 """
171 return (self._text.get_window_extent(renderer)
172 .transformed(self.get_data_transform().inverted())
173 .bounds)
174
175 def get_required_width(self, renderer):
176 """Return the minimal required width for the cell."""

Callers 1

get_required_widthMethod · 0.95

Calls 4

get_data_transformMethod · 0.80
transformedMethod · 0.45
get_window_extentMethod · 0.45
invertedMethod · 0.45

Tested by

no test coverage detected