-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Open
Milestone
Description
Summary
We currently have:
matplotlib.usematplotlib.get_backendpyplot.switch_backend
Issues:
- The name
matplotlib.useis really obscure. - The difference between
switch_backendanduseis not quite clear.
Proposed fix
- Consider renaming
matplotlib.use(and either discourace or long-term deprecateuse(with a pending deprecation)). - Check whether
useandswitch_backendcan be unified. If not, at least improve the documentation.
Side note: The force parameter in use can be dropped.
matplotlib.use(..., force=True)
is equivalent to
try:
matplotlib.use(...)
except ImportError:
pass
It should be rare that users want to ignore that changing the backend fails. And if so, they can do it explicitly. We do not need to provide API for that. The only slight complication is that this the default behavior is force=True; i.e. dropping would change the default behavor. But we can address that in the course of "renaming": We simply provide a new function, e.g. set_backend with the new behavior.