Skip to content

Commit 20f78c4

Browse files
committed
Help string of %config InlineBackend
1 parent 45ec4f1 commit 20f78c4

File tree

2 files changed

+62
-7
lines changed

2 files changed

+62
-7
lines changed

matplotlib_inline/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def _figure_format_changed(self, name, old, new):
7979
{"bbox_inches": "tight"},
8080
help="""Extra kwargs to be passed to fig.canvas.print_figure.
8181
82-
Logical examples include: bbox_inches, quality (for jpeg figures), etc.
82+
Logical examples include: bbox_inches, pil_kwargs, etc. In addition,
83+
see the docstrings of `set_matplotlib_formats`.
8384
""",
8485
).tag(config=True)
8586
_print_figure_kwargs_changed = _update_figure_formatters

tests/notebooks/config_InlineBackend.ipynb

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,60 @@
3232
{
3333
"cell_type": "code",
3434
"execution_count": 3,
35+
"id": "fbec64f3-9f8e-435f-8a92-8d9ba7c0beb7",
36+
"metadata": {},
37+
"outputs": [
38+
{
39+
"name": "stdout",
40+
"output_type": "stream",
41+
"text": [
42+
"InlineBackend(InlineBackendConfig) options\n",
43+
"----------------------------------------\n",
44+
"InlineBackend.close_figures=<Bool>\n",
45+
" Close all figures at the end of each cell.\n",
46+
" When True, ensures that each cell starts with no active figures, but it\n",
47+
" also means that one must keep track of references in order to edit or\n",
48+
" redraw figures in subsequent cells. This mode is ideal for the notebook,\n",
49+
" where residual plots from other cells might be surprising.\n",
50+
" When False, one must call figure() to create new figures. This means\n",
51+
" that gcf() and getfigs() can reference figures created in other cells,\n",
52+
" and the active figure can continue to be edited with pylab/pyplot\n",
53+
" methods that reference the current active figure. This mode facilitates\n",
54+
" iterative editing of figures, and behaves most consistently with\n",
55+
" other matplotlib backends, but figure barriers between cells must\n",
56+
" be explicit.\n",
57+
" Current: True\n",
58+
"InlineBackend.figure_format=<Unicode>\n",
59+
" The figure format to enable (deprecated\n",
60+
" use `figure_formats` instead)\n",
61+
" Current: ''\n",
62+
"InlineBackend.figure_formats=<set-item-1>...\n",
63+
" A set of figure formats to enable: 'png',\n",
64+
" 'retina', 'jpeg', 'svg', 'pdf'.\n",
65+
" Current: {'jpeg'}\n",
66+
"InlineBackend.print_figure_kwargs=<key-1>=<value-1>...\n",
67+
" Extra kwargs to be passed to fig.canvas.print_figure.\n",
68+
" Logical examples include: bbox_inches, pil_kwargs, etc. In addition,\n",
69+
" see the docstrings of `set_matplotlib_formats`.\n",
70+
" Current: {'bbox_inches': None, 'pil_kwargs': {'quality': 90, 'optimize': True}}\n",
71+
"InlineBackend.rc=<key-1>=<value-1>...\n",
72+
" Dict to manage matplotlib configuration defaults in the inline\n",
73+
" backend. As of v0.1.4 IPython/Jupyter do not override defaults out of\n",
74+
" the box, but third-party tools may use it to manage rc data. To change\n",
75+
" personal defaults for matplotlib, use matplotlib's configuration\n",
76+
" tools, or customize this class in your `ipython_config.py` file for\n",
77+
" IPython/Jupyter-specific usage.\n",
78+
" Current: {}\n"
79+
]
80+
}
81+
],
82+
"source": [
83+
"%config InlineBackend"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": 4,
3589
"id": "0e5b8951-19af-4273-80ca-23b47476d637",
3690
"metadata": {},
3791
"outputs": [
@@ -83,7 +137,7 @@
83137
},
84138
{
85139
"cell_type": "code",
86-
"execution_count": 4,
140+
"execution_count": 5,
87141
"id": "89f6de76-9d6b-43c0-b790-e6b63c4c4159",
88142
"metadata": {},
89143
"outputs": [
@@ -107,7 +161,7 @@
107161
},
108162
{
109163
"cell_type": "code",
110-
"execution_count": 5,
164+
"execution_count": 6,
111165
"id": "1fc45e92-07c2-49fa-9b3e-2c30e865e5e8",
112166
"metadata": {},
113167
"outputs": [
@@ -118,7 +172,7 @@
118172
"<Figure size 640x480 with 1 Axes>"
119173
]
120174
},
121-
"execution_count": 5,
175+
"execution_count": 6,
122176
"metadata": {},
123177
"output_type": "execute_result"
124178
}
@@ -131,19 +185,19 @@
131185
},
132186
{
133187
"cell_type": "code",
134-
"execution_count": 6,
188+
"execution_count": 7,
135189
"id": "df3590be-d87d-4c37-8f73-c652eec9a640",
136190
"metadata": {},
137191
"outputs": [
138192
{
139193
"data": {
140194
"text/plain": [
141-
"{'IPKernelApp': {'connection_file': '/Users/leo/Library/Jupyter/runtime/kernel-488a2b06-f50e-4bf3-98b5-f46e505f928c.json'},\n",
195+
"{'IPKernelApp': {'connection_file': '/Users/leo/Library/Jupyter/runtime/kernel-66b85c75-26bd-4e95-91ec-25b40babd080.json'},\n",
142196
" 'InlineBackend': {'figure_formats': {'jpeg', 'png'},\n",
143197
" 'print_figure_kwargs': {'bbox_inches': None, 'pil_kwargs': {'quality': 90}}}}"
144198
]
145199
},
146-
"execution_count": 6,
200+
"execution_count": 7,
147201
"metadata": {},
148202
"output_type": "execute_result"
149203
}

0 commit comments

Comments
 (0)