Skip to content

Commit a50b804

Browse files
committed
bigsplit: ipython_kernel
1 parent 9d1c699 commit a50b804

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

backend_inline.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def draw_if_interactive():
6565
# For further reference:
6666
# https://github.com/ipython/ipython/issues/1612
6767
# https://github.com/matplotlib/matplotlib/issues/835
68-
68+
6969
if not hasattr(fig, 'show'):
7070
# Queue up `fig` for display
7171
fig.show = lambda *a: display(fig)
@@ -94,15 +94,15 @@ def flush_figures():
9494
9595
This is meant to be called automatically and will call show() if, during
9696
prior code execution, there had been any calls to draw_if_interactive.
97-
97+
9898
This function is meant to be used as a post_execute callback in IPython,
9999
so user-caused errors are handled with showtraceback() instead of being
100100
allowed to raise. If this function is not called from within IPython,
101101
then these exceptions will raise.
102102
"""
103103
if not show._draw_called:
104104
return
105-
105+
106106
if InlineBackend.instance().close_figures:
107107
# ignore the tracking, just draw and close all figures
108108
try:
@@ -139,4 +139,3 @@ def flush_figures():
139139
# figurecanvas. This is set here to a Agg canvas
140140
# See https://github.com/matplotlib/matplotlib/pull/1125
141141
FigureCanvas = FigureCanvasAgg
142-

config.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ def _config_changed(self, name, old, new):
6868
)
6969

7070
figure_formats = Set({'png'}, config=True,
71-
help="""A set of figure formats to enable: 'png',
71+
help="""A set of figure formats to enable: 'png',
7272
'retina', 'jpeg', 'svg', 'pdf'.""")
7373

7474
def _update_figure_formatters(self):
7575
if self.shell is not None:
7676
from IPython.core.pylabtools import select_figure_formats
7777
select_figure_formats(self.shell, self.figure_formats, **self.print_figure_kwargs)
78-
78+
7979
def _figure_formats_changed(self, name, old, new):
8080
if 'jpg' in new or 'jpeg' in new:
8181
if not pil_available():
@@ -91,20 +91,20 @@ def _figure_format_changed(self, name, old, new):
9191

9292
print_figure_kwargs = Dict({'bbox_inches' : 'tight'}, config=True,
9393
help="""Extra kwargs to be passed to fig.canvas.print_figure.
94-
94+
9595
Logical examples include: bbox_inches, quality (for jpeg figures), etc.
9696
"""
9797
)
9898
_print_figure_kwargs_changed = _update_figure_formatters
99-
99+
100100
close_figures = Bool(True, config=True,
101101
help="""Close all figures at the end of each cell.
102-
102+
103103
When True, ensures that each cell starts with no active figures, but it
104104
also means that one must keep track of references in order to edit or
105105
redraw figures in subsequent cells. This mode is ideal for the notebook,
106106
where residual plots from other cells might be surprising.
107-
107+
108108
When False, one must call figure() to create new figures. This means
109109
that gcf() and getfigs() can reference figures created in other cells,
110110
and the active figure can continue to be edited with pylab/pyplot
@@ -117,4 +117,3 @@ def _figure_format_changed(self, name, old, new):
117117
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
118118
allow_none=True)
119119

120-

0 commit comments

Comments
 (0)