MCPcopy Create free account
hub / github.com/ipython/ipython / retina_figure

Function retina_figure

IPython/core/pylabtools.py:138–147  ·  view source on GitHub ↗

format a figure as a pixel-doubled (retina) PNG

(fig, **kwargs)

Source from the content-addressed store, hash-verified

136 return data
137
138def retina_figure(fig, **kwargs):
139 """format a figure as a pixel-doubled (retina) PNG"""
140 pngdata = print_figure(fig, fmt='retina', **kwargs)
141 # Make sure that retina_figure acts just like print_figure and returns
142 # None when the figure is empty.
143 if pngdata is None:
144 return
145 w, h = _pngxy(pngdata)
146 metadata = {"width": w//2, "height":h//2}
147 return pngdata, metadata
148
149# We need a little factory function here to create the closure where
150# safe_execfile can live.

Callers 1

select_figure_formatsFunction · 0.85

Calls 2

_pngxyFunction · 0.90
print_figureFunction · 0.85

Tested by

no test coverage detected