File tree 1 file changed +8
-0
lines changed
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,18 +263,21 @@ 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
global _backend_mod
264
270
_warn_if_gui_out_of_main_thread ()
265
271
return _backend_mod .new_figure_manager (* args , ** kwargs )
266
272
267
273
274
+ # This function's signature is rewritten upon backend-load by switch_backend.
268
275
def draw_if_interactive (* args , ** kwargs ):
269
276
global _backend_mod
270
277
return _backend_mod .draw_if_interactive (* args , ** kwargs )
271
278
272
279
280
+ # This function's signature is rewritten upon backend-load by switch_backend.
273
281
def show (* args , ** kwargs ):
274
282
"""
275
283
Display all figures.
You can’t perform that action at this time.
0 commit comments