List of all available matplotlib backends

后端 未结 7 2133
情话喂你
情话喂你 2020-11-27 13:06

The current backend name is accessible via

>>> import matplotlib.pyplot as plt
>>> plt.get_backend()
\'GTKAgg\'

Is there a way to get a list of all ba

7条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 13:08

    You can access the lists

    matplotlib.rcsetup.interactive_bk
    matplotlib.rcsetup.non_interactive_bk
    matplotlib.rcsetup.all_backends
    

    the third being the concatenation of the former two. If I read the source code correctly, those lists are hard-coded though, and don't tell you what backends are actually usable. There is also

    matplotlib.rcsetup.validate_backend(name)
    

    but this also only checks against the hard-coded list.

提交回复
热议问题