Primary
matplotlib.use() ⚬|Documentation|1st|20260605005430-00-⌔
matplotlib — Matplotlib 3.10.9 documentation#matplotlib.use
matplotlib.use(backend, ﹡, force=True)Select the backend used for rendering and GUI integration.
If pyplot is already imported,
switch_backendis used to switch the backend.Parameters:
backend: strThe backend to switch to. This can either be one of the standard backend names, which are case-insensitive:
- interactive backends: GTK3Agg, GTK3Cairo, GTK4Agg, GTK4Cairo, MacOSX, nbAgg, notebook, QtAgg, QtCairo, TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo
- non-interactive backends: agg, cairo, pdf, pgf, ps, svg, template
or a string of the form:
module://my.module.name.notebook is a synonym for nbAgg.
Switching to an interactive backend is not possible if an unrelated event loop has already been started (e.g., switching to GTK3Agg if a TkAgg window has already been opened). Switching to a non-interactive backend is always possible.
force: bool, default: TrueIf True (the default), raise an
ImportErrorif the backend cannot be set up (either because it fails to import, or because an incompatible GUI interactive framework is already running); if False, silently ignore the failure.See also:
Backends
matplotlib.get_backend
matplotlib.pyplot.switch_backendPrinted 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •