Return the name of the current backend. Parameters ---------- auto_select : bool, default: True Whether to trigger backend resolution if no backend has been selected so far. If True, this ensures that a valid backend is returned. If False, this returns None
(*, auto_select=True)
| 1290 | |
| 1291 | |
| 1292 | def get_backend(*, auto_select=True): |
| 1293 | """ |
| 1294 | Return the name of the current backend. |
| 1295 | |
| 1296 | Parameters |
| 1297 | ---------- |
| 1298 | auto_select : bool, default: True |
| 1299 | Whether to trigger backend resolution if no backend has been |
| 1300 | selected so far. If True, this ensures that a valid backend |
| 1301 | is returned. If False, this returns None if no backend has been |
| 1302 | selected so far. |
| 1303 | |
| 1304 | .. versionadded:: 3.10 |
| 1305 | |
| 1306 | .. admonition:: Provisional |
| 1307 | |
| 1308 | The *auto_select* flag is provisional. It may be changed or removed |
| 1309 | without prior warning. |
| 1310 | |
| 1311 | See Also |
| 1312 | -------- |
| 1313 | matplotlib.use |
| 1314 | """ |
| 1315 | if auto_select: |
| 1316 | return rcParams['backend'] |
| 1317 | else: |
| 1318 | backend = rcParams._get('backend') |
| 1319 | if backend is rcsetup._auto_backend_sentinel: |
| 1320 | return None |
| 1321 | else: |
| 1322 | return backend |
| 1323 | |
| 1324 | |
| 1325 | def interactive(b): |
no test coverage detected
searching dependent graphs…