File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,11 @@ def switch_backend(newbackend):
224
224
rcParamsOrig ["backend" ] = "agg"
225
225
return
226
226
227
+ # Backends are implemented as modules, but "inherit" default method
228
+ # implementations from backend_bases._Backend. This is achieved by
229
+ # creating a "class" that inherits from backend_bases._Backend and whose
230
+ # body is filled with the module's globals.
231
+
227
232
backend_name = cbook ._backend_module_name (newbackend )
228
233
229
234
class _backend_mod (matplotlib .backend_bases ._Backend ):
@@ -261,18 +266,21 @@ def _warn_if_gui_out_of_main_thread():
261
266
"fail." )
262
267
263
268
269
+ # This function's signature is rewritten upon backend-load by switch_backend.
264
270
def new_figure_manager (* args , ** kwargs ):
265
271
"""Create a new figure manager instance."""
266
272
global _backend_mod
267
273
_warn_if_gui_out_of_main_thread ()
268
274
return _backend_mod .new_figure_manager (* args , ** kwargs )
269
275
270
276
277
+ # This function's signature is rewritten upon backend-load by switch_backend.
271
278
def draw_if_interactive (* args , ** kwargs ):
272
279
global _backend_mod
273
280
return _backend_mod .draw_if_interactive (* args , ** kwargs )
274
281
275
282
283
+ # This function's signature is rewritten upon backend-load by switch_backend.
276
284
def show (* args , ** kwargs ):
277
285
"""
278
286
Display all figures.
You can’t perform that action at this time.
0 commit comments