File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 22
33
44class BackendFilter (Enum ):
5+ """
6+ Filter used with :meth:`~.BackendRegistry.list_builtins`
7+
8+ .. versionadded:: 3.9
9+ """
510 INTERACTIVE = 0
611 NON_INTERACTIVE = 1
712
@@ -11,6 +16,8 @@ class BackendRegistry:
1116 Registry of backends available within Matplotlib.
1217
1318 This is the single source of truth for available backends.
19+
20+ .. versionadded:: 3.9
1421 """
1522 # Built-in backends are those which are included in the Matplotlib repo.
1623 # A backend with name 'name' is located in the module
@@ -41,9 +48,36 @@ class BackendRegistry:
4148 }
4249
4350 def backend_for_gui_framework (self , framework ):
51+ """
52+ Return the name of the backend corresponding to the specified GUI framework.
53+
54+ Parameters
55+ ----------
56+ framework : str
57+ GUI framework such as "qt".
58+
59+ Returns
60+ -------
61+ str
62+ Backend name.
63+ """
4464 return self ._GUI_FRAMEWORK_TO_BACKEND_MAPPING .get (framework )
4565
4666 def list_builtin (self , filter_ = None ):
67+ """
68+ Return list of backends that are built into Matplotlib.
69+
70+ Parameters
71+ ----------
72+ filter_ : `~.BackendFilter`, optional
73+ Filter to apply to returned backends. For example, to return only
74+ non-interactive backends use `.BackendFilter.NON_INTERACTIVE`.
75+
76+ Returns
77+ -------
78+ list of str
79+ Backend names.
80+ """
4781 if filter_ == BackendFilter .INTERACTIVE :
4882 return self ._BUILTIN_INTERACTIVE
4983 elif filter_ == BackendFilter .NON_INTERACTIVE :
You can’t perform that action at this time.
0 commit comments