format a figure as a pixel-doubled (retina) PNG
(fig, **kwargs)
| 136 | return data |
| 137 | |
| 138 | def 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. |
no test coverage detected