File tree 1 file changed +6
-11
lines changed
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,11 @@ def _draw_all_if_interactive():
122
122
123
123
def install_repl_displayhook ():
124
124
"""
125
- Install a repl display hook so that any stale figure are automatically
126
- redrawn when control is returned to the repl.
125
+ Connect to the display hook of the current shell.
126
+
127
+ The display hook gets called when the read-evaluate-print-loop (REPL) of
128
+ the shell has finished the execution of a command. We use this callback
129
+ to be able to automatically update a figure in interactive mode.
127
130
128
131
This works both with IPython and with vanilla python shells.
129
132
"""
@@ -155,15 +158,7 @@ def install_repl_displayhook():
155
158
156
159
157
160
def uninstall_repl_displayhook ():
158
- """
159
- Uninstall the Matplotlib display hook.
160
-
161
- .. warning::
162
-
163
- If you are using vanilla python and have installed another display hook,
164
- this will reset `sys.displayhook` to what ever function was there when
165
- Matplotlib installed its displayhook, possibly discarding your changes.
166
- """
161
+ """Disconnect from the display hook of the current shell."""
167
162
global _REPL_DISPLAYHOOK
168
163
if _REPL_DISPLAYHOOK is _ReplDisplayHook .IPYTHON :
169
164
from IPython import get_ipython
You can’t perform that action at this time.
0 commit comments