|
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | 5 | "execution_count": 1, |
| 6 | + "id": "c235d5cb-9181-4579-855c-b7da77261bd7", |
| 7 | + "metadata": {}, |
| 8 | + "outputs": [], |
| 9 | + "source": [ |
| 10 | + "#NBVAL_IGNORE_OUTPUT\n", |
| 11 | + "%matplotlib inline" |
| 12 | + ] |
| 13 | + }, |
| 14 | + { |
| 15 | + "cell_type": "code", |
| 16 | + "execution_count": 2, |
6 | 17 | "id": "e4221445-5518-4984-b731-aaf9840141d8", |
7 | 18 | "metadata": {}, |
8 | 19 | "outputs": [], |
9 | 20 | "source": [ |
10 | | - "%matplotlib inline\n", |
11 | 21 | "%config InlineBackend.figure_formats = 'jpeg'\n", |
12 | 22 | "%config InlineBackend.print_figure_kwargs = \\\n", |
13 | 23 | " {'bbox_inches': None, \\\n", |
|
16 | 26 | "\n", |
17 | 27 | "import matplotlib.pyplot as plt\n", |
18 | 28 | "from matplotlib_inline.backend_inline import set_matplotlib_formats\n", |
19 | | - "from pprint import pprint\n", |
20 | 29 | "from traitlets.config import get_config" |
21 | 30 | ] |
22 | 31 | }, |
23 | 32 | { |
24 | 33 | "cell_type": "code", |
25 | | - "execution_count": 2, |
| 34 | + "execution_count": 3, |
26 | 35 | "id": "0e5b8951-19af-4273-80ca-23b47476d637", |
27 | | - "metadata": { |
28 | | - "editable": true, |
29 | | - "slideshow": { |
30 | | - "slide_type": "" |
31 | | - }, |
32 | | - "tags": [] |
33 | | - }, |
| 36 | + "metadata": {}, |
34 | 37 | "outputs": [ |
35 | 38 | { |
36 | 39 | "name": "stdout", |
|
68 | 71 | "\n", |
69 | 72 | " In addition, see the docstrings of `plt.savefig()`,\n", |
70 | 73 | " `matplotlib.figure.Figure.savefig()`, `PIL.Image.Image.save()` and\n", |
71 | | - " https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html\n", |
| 74 | + " :ref:`Pillow Image file formats <handbook/image-file-formats>`.\n", |
72 | 75 | "\n" |
73 | 76 | ] |
74 | 77 | } |
75 | 78 | ], |
76 | 79 | "source": [ |
| 80 | + "#NBVAL_IGNORE_OUTPUT\n", |
77 | 81 | "help(set_matplotlib_formats)" |
78 | 82 | ] |
79 | 83 | }, |
80 | 84 | { |
81 | 85 | "cell_type": "code", |
82 | | - "execution_count": 3, |
| 86 | + "execution_count": 4, |
83 | 87 | "id": "89f6de76-9d6b-43c0-b790-e6b63c4c4159", |
84 | | - "metadata": { |
85 | | - "editable": true, |
86 | | - "slideshow": { |
87 | | - "slide_type": "" |
88 | | - }, |
89 | | - "tags": [] |
90 | | - }, |
| 88 | + "metadata": {}, |
91 | 89 | "outputs": [ |
92 | 90 | { |
93 | 91 | "data": { |
|
109 | 107 | }, |
110 | 108 | { |
111 | 109 | "cell_type": "code", |
112 | | - "execution_count": 4, |
| 110 | + "execution_count": 5, |
113 | 111 | "id": "1fc45e92-07c2-49fa-9b3e-2c30e865e5e8", |
114 | | - "metadata": { |
115 | | - "editable": true, |
116 | | - "slideshow": { |
117 | | - "slide_type": "" |
118 | | - }, |
119 | | - "tags": [] |
120 | | - }, |
| 112 | + "metadata": {}, |
121 | 113 | "outputs": [ |
122 | 114 | { |
123 | 115 | "data": { |
|
126 | 118 | "<Figure size 640x480 with 1 Axes>" |
127 | 119 | ] |
128 | 120 | }, |
129 | | - "execution_count": 4, |
| 121 | + "execution_count": 5, |
130 | 122 | "metadata": {}, |
131 | 123 | "output_type": "execute_result" |
132 | 124 | } |
|
139 | 131 | }, |
140 | 132 | { |
141 | 133 | "cell_type": "code", |
142 | | - "execution_count": null, |
| 134 | + "execution_count": 6, |
143 | 135 | "id": "df3590be-d87d-4c37-8f73-c652eec9a640", |
144 | | - "metadata": { |
145 | | - "editable": true, |
146 | | - "nbreg": { |
147 | | - "diff_ignore": [ |
148 | | - "/outputs/*/text/plain" |
149 | | - ] |
150 | | - }, |
151 | | - "slideshow": { |
152 | | - "slide_type": "" |
153 | | - }, |
154 | | - "tags": [] |
155 | | - }, |
156 | | - "outputs": [], |
| 136 | + "metadata": {}, |
| 137 | + "outputs": [ |
| 138 | + { |
| 139 | + "data": { |
| 140 | + "text/plain": [ |
| 141 | + "{'IPKernelApp': {'connection_file': '/Users/leo/Library/Jupyter/runtime/kernel-488a2b06-f50e-4bf3-98b5-f46e505f928c.json'},\n", |
| 142 | + " 'InlineBackend': {'figure_formats': {'jpeg', 'png'},\n", |
| 143 | + " 'print_figure_kwargs': {'bbox_inches': None, 'pil_kwargs': {'quality': 90}}}}" |
| 144 | + ] |
| 145 | + }, |
| 146 | + "execution_count": 6, |
| 147 | + "metadata": {}, |
| 148 | + "output_type": "execute_result" |
| 149 | + } |
| 150 | + ], |
157 | 151 | "source": [ |
158 | | - "# WARNING: clear cell output, before test and/or commit.\n", |
159 | | - "# For demonstration purposes only, the Inline Back-end\n", |
160 | | - "# configuration does not change.\n", |
161 | | - "\n", |
| 152 | + "#NBVAL_IGNORE_OUTPUT\n", |
162 | 153 | "c = get_config()\n", |
163 | 154 | "c.InlineBackend.figure_formats = {'png', 'jpeg'}\n", |
164 | 155 | "c.InlineBackend.print_figure_kwargs.update({\n", |
165 | | - " 'pil_kwargs': {'quality' : 99}\n", |
| 156 | + " 'pil_kwargs': {'quality' : 90}\n", |
166 | 157 | " })\n", |
167 | 158 | "c" |
168 | 159 | ] |
|
0 commit comments