Renderer to display figures as static PNG images. This renderer requires either the kaleido package or the orca command-line utility and is broadly compatible across IPython environments (classic Jupyter Notebook, JupyterLab, QtConsole, VSCode, PyCharm, etc) and nbconvert targets (
| 139 | |
| 140 | |
| 141 | class PngRenderer(ImageRenderer): |
| 142 | """ |
| 143 | Renderer to display figures as static PNG images. This renderer requires |
| 144 | either the kaleido package or the orca command-line utility and is broadly |
| 145 | compatible across IPython environments (classic Jupyter Notebook, JupyterLab, |
| 146 | QtConsole, VSCode, PyCharm, etc) and nbconvert targets (HTML, PDF, etc.). |
| 147 | |
| 148 | mime type: 'image/png' |
| 149 | """ |
| 150 | |
| 151 | def __init__(self, width=None, height=None, scale=None, engine=None): |
| 152 | super(PngRenderer, self).__init__( |
| 153 | mime_type="image/png", |
| 154 | b64_encode=True, |
| 155 | format="png", |
| 156 | width=width, |
| 157 | height=height, |
| 158 | scale=scale, |
| 159 | engine=engine, |
| 160 | ) |
| 161 | |
| 162 | |
| 163 | class SvgRenderer(ImageRenderer): |