Consistent theming across Plotly Express, plain Figure plots and Cufflinks plots?

I have a Jupyter notebooks that contains plots that are displayed using all of the following:

  • Plotly Express
  • Maually constructed Figure dictionary + py.iplot()
  • cufflinks + py.iplot()

These all produce plots with different appearances due to different default themes. Is there a convenient way I can globally enforce all these plots to have the same appearance without modifying the code of each plot?

Plotly and Plotly Express respect the default theme, which is settable with:

import plotly.io as pio
pio.templates.default = ...

I donโ€™t know about Cufflinks :man_shrugging:

Ah great, thanks! That helps unify plotly express plots with manually produced Figure plots, but sadly it looks like cufflinks does not support the default theme.

It looks like it does have its own theming system that is entirely separate though, however it only has a handful to choose from:

import cufflinks as cf
cf.getThemes()

Gives:

['pearl', 'white', 'ggplot', 'solar', 'space']

To set the theme:

cf.set_config_file(theme='pearl')

Yeah, Iโ€™ll reach out to the Cufflinks maintainer to talk about a new major version thatโ€™s more v4-compatible including returning Figures and supporting the new theming system :slight_smile:

2 Likes

Thanks heaps for the help!