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

Method _get_nth_label_width

lib/matplotlib/contour.py:245–252  ·  view source on GitHub ↗

Return the width of the *nth* label, in pixels.

(self, nth)

Source from the content-addressed store, hash-verified

243 for loc in self.labelXYs)
244
245 def _get_nth_label_width(self, nth):
246 """Return the width of the *nth* label, in pixels."""
247 fig = self.axes.get_figure(root=False)
248 renderer = fig.get_figure(root=True)._get_renderer()
249 return (Text(0, 0,
250 self.get_text(self.labelLevelList[nth], self.labelFmt),
251 figure=fig, fontproperties=self._label_font_props)
252 .get_window_extent(renderer).width)
253
254 def get_text(self, lev, fmt):
255 """Get the text of the label."""

Callers 2

add_label_nearMethod · 0.95
labelsMethod · 0.95

Calls 5

get_textMethod · 0.95
TextClass · 0.90
get_figureMethod · 0.45
_get_rendererMethod · 0.45
get_window_extentMethod · 0.45

Tested by

no test coverage detected