You are reading an old version of the documentation (v2.2.3). For the latest version see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.switch_backend.html
Version 2.2.3
matplotlib
Fork me on GitHub

matplotlib.pyplot.switch_backend

matplotlib.pyplot.switch_backend(newbackend)[source]

Switch the default backend. This feature is experimental, and is only expected to work switching to an image backend. e.g., if you have a bunch of PostScript scripts that you want to run from an interactive ipython session, you may want to switch to the PS backend before running them to avoid having a bunch of GUI windows popup. If you try to interactively switch from one GUI backend to another, you will explode.

Calling this command will close all open windows.