MCPcopy Index your code
hub / github.com/fabioz/PyDev.Debugger / activate_matplotlib

Function activate_matplotlib

pydev_ipython/matplotlibtools.py:128–145  ·  view source on GitHub ↗

Set interactive to True for interactive backends. enable_gui_function - Function which enables gui, should be run in the main thread.

(enable_gui_function)

Source from the content-addressed store, hash-verified

126
127
128def activate_matplotlib(enable_gui_function):
129 """Set interactive to True for interactive backends.
130 enable_gui_function - Function which enables gui, should be run in the main thread.
131 """
132 matplotlib = sys.modules["matplotlib"]
133 gui, backend = find_gui_and_backend()
134 is_interactive = is_interactive_backend(backend)
135 if is_interactive:
136 enable_gui_function(gui)
137 if not matplotlib.is_interactive():
138 sys.stdout.write("Backend %s is interactive backend. Turning interactive mode on.\n" % backend)
139 matplotlib.interactive(True)
140 else:
141 if matplotlib.is_interactive():
142 sys.stdout.write("Backend %s is non-interactive backend. Turning interactive mode off.\n" % backend)
143 matplotlib.interactive(False)
144 patch_use(enable_gui_function)
145 patch_is_interactive()
146
147
148def flag_calls(func):

Callers 2

init_gui_supportMethod · 0.90

Calls 7

find_gui_and_backendFunction · 0.85
is_interactive_backendFunction · 0.85
patch_useFunction · 0.85
patch_is_interactiveFunction · 0.85
is_interactiveMethod · 0.80
interactiveMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected