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

Method _repr_png_

lib/matplotlib/font_manager.py:414–421  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

412 return f"<img src=\"data:image/png;base64, {png_b64}\" />"
413
414 def _repr_png_(self) -> bytes:
415 from matplotlib.figure import Figure # Circular import.
416 fig = Figure()
417 font_path = Path(self.fname) if self.fname != '' else None
418 fig.text(0, 0, self.name, font=font_path)
419 with BytesIO() as buf:
420 fig.savefig(buf, bbox_inches='tight', transparent=True)
421 return buf.getvalue()
422
423
424def ttfFontProperty(font):

Callers 2

_repr_html_Method · 0.95
test_fontentry_dataclassFunction · 0.95

Calls 4

savefigMethod · 0.95
FigureClass · 0.90
PathClass · 0.85
textMethod · 0.45

Tested by 1

test_fontentry_dataclassFunction · 0.76