Ensure that a backend is selected and return it. This is currently private, but may be made public in the future.
()
| 378 | |
| 379 | |
| 380 | def _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 | |
| 394 | def switch_backend(newbackend: str) -> None: |
no test coverage detected
searching dependent graphs…