List of all available matplotlib backends

后端 未结 7 2146
情话喂你
情话喂你 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条回答
  •  Happy的楠姐
    2020-11-27 13:26

    You can pretend to put a wrong backend argument, then it will return you a ValueError with the list of valid matplotlib backends, like this:

    Input:

    import matplotlib
    matplotlib.use('WRONG_ARG')
    

    Output:

    ValueError: Unrecognized backend string 'test': valid strings are ['GTK3Agg', 'GTK3Cairo', 'MacOSX', 'nbAgg', 'Qt4Agg', 'Qt4Cairo', 'Qt5Agg', 'Qt
    5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']
    

提交回复
热议问题