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 @@ -221,6 +221,11 @@ def switch_backend(newbackend):
221
221
rcParamsOrig ["backend" ] = "agg"
222
222
return
223
223
224
+ # Backends are implemented as modules, but "inherit" default method
225
+ # implementations from backend_bases._Backend. This is achieved by
226
+ # creating a "class" that inherits from backend_bases._Backend and whose
227
+ # body is filled with the module's globals.
228
+
224
229
backend_name = cbook ._backend_module_name (newbackend )
225
230
226
231
class backend_mod (matplotlib .backend_bases ._Backend ):
@@ -258,16 +263,19 @@ def _warn_if_gui_out_of_main_thread():
258
263
"fail." )
259
264
260
265
266
+ # This function's signature is rewritten upon backend-load by switch_backend.
261
267
def new_figure_manager (* args , ** kwargs ):
262
268
"""Create a new figure manager instance."""
263
269
_warn_if_gui_out_of_main_thread ()
264
270
return _backend_mod .new_figure_manager (* args , ** kwargs )
265
271
266
272
273
+ # This function's signature is rewritten upon backend-load by switch_backend.
267
274
def draw_if_interactive (* args , ** kwargs ):
268
275
return _backend_mod .draw_if_interactive (* args , ** kwargs )
269
276
270
277
278
+ # This function's signature is rewritten upon backend-load by switch_backend.
271
279
def show (* args , ** kwargs ):
272
280
"""
273
281
Display all figures.
You can’t perform that action at this time.
0 commit comments