File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2715,12 +2715,15 @@ def polar(*args, **kwargs) -> list[Line2D]:
2715
2715
# If rcParams['backend_fallback'] is true, and an interactive backend is
2716
2716
# requested, ignore rcParams['backend'] and force selection of a backend that
2717
2717
# is compatible with the current running interactive framework.
2718
- if (rcParams ["backend_fallback" ]
2719
- and rcParams ._get_backend_or_none () in ( # type: ignore[attr-defined]
2720
- set (backend_registry .list_builtin (BackendFilter .INTERACTIVE )) -
2721
- {'webagg' , 'nbagg' })
2722
- and cbook ._get_running_interactive_framework ()):
2723
- rcParams ._set ("backend" , rcsetup ._auto_backend_sentinel )
2718
+ if rcParams ["backend_fallback" ]:
2719
+ requested_backend = rcParams ._get_backend_or_none () # type: ignore[attr-defined]
2720
+ requested_backend = None if requested_backend is None else requested_backend .lower ()
2721
+ available_backends = backend_registry .list_builtin (BackendFilter .INTERACTIVE )
2722
+ if (
2723
+ requested_backend in (set (available_backends ) - {'webagg' , 'nbagg' })
2724
+ and cbook ._get_running_interactive_framework ()
2725
+ ):
2726
+ rcParams ._set ("backend" , rcsetup ._auto_backend_sentinel )
2724
2727
2725
2728
# fmt: on
2726
2729
You can’t perform that action at this time.
0 commit comments