MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _get_backend_mod

Function _get_backend_mod

lib/matplotlib/pyplot.py:380–391  ·  view source on GitHub ↗

Ensure that a backend is selected and return it. This is currently private, but may be made public in the future.

()

Source from the content-addressed store, hash-verified

378
379
380def _get_backend_mod() -> type[matplotlib.backend_bases._Backend]:
381 """
382 Ensure that a backend is selected and return it.
383
384 This is currently private, but may be made public in the future.
385 """
386 if _backend_mod is None:
387 # Use rcParams._get("backend") to avoid going through the fallback
388 # logic (which will (re)import pyplot and then call switch_backend if
389 # we need to resolve the auto sentinel)
390 switch_backend(rcParams._get("backend"))
391 return cast(type[matplotlib.backend_bases._Backend], _backend_mod)
392
393
394def switch_backend(newbackend: str) -> None:

Callers 5

new_figure_managerFunction · 0.85
draw_if_interactiveFunction · 0.85
showFunction · 0.85
figureFunction · 0.85

Calls 2

switch_backendFunction · 0.85
_getMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…