File tree 1 file changed +34
-0
lines changed 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
4
4
class BackendFilter (Enum ):
5
+ """
6
+ Filter used with :meth:`~.BackendRegistry.list_builtins`
7
+
8
+ .. versionadded:: 3.9
9
+ """
5
10
INTERACTIVE = 0
6
11
NON_INTERACTIVE = 1
7
12
@@ -11,6 +16,8 @@ class BackendRegistry:
11
16
Registry of backends available within Matplotlib.
12
17
13
18
This is the single source of truth for available backends.
19
+
20
+ .. versionadded:: 3.9
14
21
"""
15
22
# Built-in backends are those which are included in the Matplotlib repo.
16
23
# A backend with name 'name' is located in the module
@@ -41,9 +48,36 @@ class BackendRegistry:
41
48
}
42
49
43
50
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
+ """
44
64
return self ._GUI_FRAMEWORK_TO_BACKEND_MAPPING .get (framework )
45
65
46
66
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
+ """
47
81
if filter_ == BackendFilter .INTERACTIVE :
48
82
return self ._BUILTIN_INTERACTIVE
49
83
elif filter_ == BackendFilter .NON_INTERACTIVE :
You can’t perform that action at this time.
0 commit comments