|
15 | 15 | " 'optimize': True}}\n", |
16 | 16 | "\n", |
17 | 17 | "import matplotlib.pyplot as plt\n", |
18 | | - "from matplotlib_inline.backend_inline import set_matplotlib_formats\n", |
19 | | - "#from traitlets.config import get_config" |
| 18 | + "from matplotlib_inline.backend_inline import set_matplotlib_formats" |
20 | 19 | ] |
21 | 20 | }, |
22 | 21 | { |
|
127 | 126 | "metadata": {}, |
128 | 127 | "outputs": [ |
129 | 128 | { |
130 | | - "data": { |
131 | | - "text/plain": [ |
132 | | - "{'IPKernelApp': {'connection_file': '/Users/leo/Library/Jupyter/runtime/kernel-15ea40aa-4b88-4253-8c45-b282c31584c8.json'},\n", |
133 | | - " 'InlineBackend': {'figure_formats': {'jpeg', 'png'},\n", |
134 | | - " 'print_figure_kwargs': {'bbox_inches': None, 'pil_kwargs': {'quality': 99}}}}" |
135 | | - ] |
136 | | - }, |
137 | | - "execution_count": 5, |
138 | | - "metadata": {}, |
139 | | - "output_type": "execute_result" |
| 129 | + "name": "stdout", |
| 130 | + "output_type": "stream", |
| 131 | + "text": [ |
| 132 | + "{'IPKernelApp': {'connection_file': 'C:\\\\Users\\\\leo\\\\AppData\\\\Roaming\\\\jupyter\\\\runtime\\\\kernel-f8c8036d-dc80-4842-ab30-cb8a4413327d.json'},\n", |
| 133 | + " 'InlineBackend': {'figure_formats': {'png', 'jpeg'},\n", |
| 134 | + " 'print_figure_kwargs': {'bbox_inches': None,\n", |
| 135 | + " 'pil_kwargs': {'quality': 90}}}}\n" |
| 136 | + ] |
140 | 137 | } |
141 | 138 | ], |
142 | 139 | "source": [ |
143 | 140 | "#NBVAL_IGNORE_OUTPUT\n", |
144 | 141 | "# For demonstration purposes only, the Inline Back-end\n", |
145 | 142 | "# configuration does not change.\n", |
146 | | - "\n", |
147 | | - "#c = get_config()\n", |
148 | | - "#c.InlineBackend.figure_formats = {'png', 'jpeg'}\n", |
149 | | - "#c.InlineBackend.print_figure_kwargs.update({\n", |
150 | | - "# 'pil_kwargs': {'quality' : 99}\n", |
151 | | - "# })\n", |
152 | | - "#c" |
| 143 | + "try:\n", |
| 144 | + " import pprint\n", |
| 145 | + " from traitlets.config import get_config\n", |
| 146 | + " c = get_config()\n", |
| 147 | + " c.InlineBackend.figure_formats = {'png', 'jpeg'}\n", |
| 148 | + " c.InlineBackend.print_figure_kwargs.update({\n", |
| 149 | + " 'pil_kwargs': {'quality' : 90}\n", |
| 150 | + " })\n", |
| 151 | + " pprint.pprint(c)\n", |
| 152 | + "except ImportError as e:\n", |
| 153 | + " print(e)" |
153 | 154 | ] |
154 | 155 | } |
155 | 156 | ], |
|
0 commit comments