You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 3.1.0.post1213+g63d96d286
matplotlib
Fork me on GitHub

matplotlib.pyplot.switch_backend

matplotlib.pyplot.switch_backend(newbackend)[source]

Close all open figures and set the Matplotlib backend.

The argument is case-insensitive. Switching to an interactive backend is possible only if no event loop for another interactive backend has started. Switching to and from non-interactive backends is always possible.

Parameters:
newbackend : str

The name of the backend to use.