Is there a way to list all available third-party plotting backends in pandas (programmatically, in Python code)?

Viewed 71

In Pandas, the list of available plotting backends changes and get updated over time, but is there a function/attribute to actually print them?

https://pandas.pydata.org/pandas-docs/stable/development/extending.html#plotting-backends

I understand I can query the existing one like this:

print(pd.options.plotting.backend)
matplotlib

Or, for example, if I need all the templates in plotly, I can write:

import plotly.io as pio
pio.templates

And then I get:

Default template: 'plotly'
Available templates:
    ['ggplot2', 'seaborn', 'simple_white', 'plotly',
     'plotly_white', 'plotly_dark', 'presentation', 'xgridoff',
     'ygridoff', 'gridon', 'none']

Is is possible to get such information for the available pandas plotting backends, too?

1 Answers

I don't know a way of getting a list, but in the question/answer here are the available backends that I know of:

Which plotting backends does pandas support for DataFrames?

In short:
matplotlib, plotly, altair, holoviews, hvplot, pandas_bokeh.

You need to have the plotting library installed for it to work as a plotting backend.

You can set the backend for the whole session as follows:

pd.options.plotting.backend = 'plotly'

Or for just one plot like this:

df.plot(backend='plotly')
Related