Skip to content

Commit 45ec4f1

Browse files
committed
Correcting by Carreau reviewe
1 parent c91c036 commit 45ec4f1

File tree

2 files changed

+39
-48
lines changed

2 files changed

+39
-48
lines changed

matplotlib_inline/backend_inline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def set_matplotlib_formats(*formats, **kwargs):
300300
301301
In addition, see the docstrings of `plt.savefig()`,
302302
`matplotlib.figure.Figure.savefig()`, `PIL.Image.Image.save()` and
303-
https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html
303+
:ref:`Pillow Image file formats <handbook/image-file-formats>`.
304304
"""
305305
# build kwargs, starting with InlineBackend config
306306
cfg = InlineBackend.instance()

tests/notebooks/config_InlineBackend.ipynb

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
{
44
"cell_type": "code",
55
"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,
617
"id": "e4221445-5518-4984-b731-aaf9840141d8",
718
"metadata": {},
819
"outputs": [],
920
"source": [
10-
"%matplotlib inline\n",
1121
"%config InlineBackend.figure_formats = 'jpeg'\n",
1222
"%config InlineBackend.print_figure_kwargs = \\\n",
1323
" {'bbox_inches': None, \\\n",
@@ -16,21 +26,14 @@
1626
"\n",
1727
"import matplotlib.pyplot as plt\n",
1828
"from matplotlib_inline.backend_inline import set_matplotlib_formats\n",
19-
"from pprint import pprint\n",
2029
"from traitlets.config import get_config"
2130
]
2231
},
2332
{
2433
"cell_type": "code",
25-
"execution_count": 2,
34+
"execution_count": 3,
2635
"id": "0e5b8951-19af-4273-80ca-23b47476d637",
27-
"metadata": {
28-
"editable": true,
29-
"slideshow": {
30-
"slide_type": ""
31-
},
32-
"tags": []
33-
},
36+
"metadata": {},
3437
"outputs": [
3538
{
3639
"name": "stdout",
@@ -68,26 +71,21 @@
6871
"\n",
6972
" In addition, see the docstrings of `plt.savefig()`,\n",
7073
" `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",
7275
"\n"
7376
]
7477
}
7578
],
7679
"source": [
80+
"#NBVAL_IGNORE_OUTPUT\n",
7781
"help(set_matplotlib_formats)"
7882
]
7983
},
8084
{
8185
"cell_type": "code",
82-
"execution_count": 3,
86+
"execution_count": 4,
8387
"id": "89f6de76-9d6b-43c0-b790-e6b63c4c4159",
84-
"metadata": {
85-
"editable": true,
86-
"slideshow": {
87-
"slide_type": ""
88-
},
89-
"tags": []
90-
},
88+
"metadata": {},
9189
"outputs": [
9290
{
9391
"data": {
@@ -109,15 +107,9 @@
109107
},
110108
{
111109
"cell_type": "code",
112-
"execution_count": 4,
110+
"execution_count": 5,
113111
"id": "1fc45e92-07c2-49fa-9b3e-2c30e865e5e8",
114-
"metadata": {
115-
"editable": true,
116-
"slideshow": {
117-
"slide_type": ""
118-
},
119-
"tags": []
120-
},
112+
"metadata": {},
121113
"outputs": [
122114
{
123115
"data": {
@@ -126,7 +118,7 @@
126118
"<Figure size 640x480 with 1 Axes>"
127119
]
128120
},
129-
"execution_count": 4,
121+
"execution_count": 5,
130122
"metadata": {},
131123
"output_type": "execute_result"
132124
}
@@ -139,30 +131,29 @@
139131
},
140132
{
141133
"cell_type": "code",
142-
"execution_count": null,
134+
"execution_count": 6,
143135
"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+
],
157151
"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",
162153
"c = get_config()\n",
163154
"c.InlineBackend.figure_formats = {'png', 'jpeg'}\n",
164155
"c.InlineBackend.print_figure_kwargs.update({\n",
165-
" 'pil_kwargs': {'quality' : 99}\n",
156+
" 'pil_kwargs': {'quality' : 90}\n",
166157
" })\n",
167158
"c"
168159
]

0 commit comments

Comments
 (0)