Skip to content

Add a public backend fallback API #17386

@anntzer

Description

@anntzer

Bug report

Bug summary

Back in #11600/#11896 I added backend fallback autodetection, which (by default) picks the first available backend among macosx, qt5agg, qt4agg, gtk3agg, etc. Initially the fallback order was configurable, but that got removed before the PRs were merged because of concerns about the API. I would like to revive that feature (essentially so that I can configure my envs to use module://mplcairo.qt by default, but module://mplcairo.base when no $DISPLAY is available). In itself it's not really hard, it's just a matter of what API we expose. One concern was that the initial approach was to put the list of backends to attempt in rcParams["backend"], which made that entry "active" (it's not just a plain dict entry, but something rather more complicated). One possible API (considering that this mostly just only needs to work before importing matplotlib) may be to only support configuring this in the $MPLBACKEND environment variable, which could e.g. be set to a (semi?)colon-separated list of backends to attempt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy