I have a Jupyter notebooks that contains plots that are displayed using all of the following:
- Plotly Express
- Maually constructed
Figure dictionary +
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
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
['pearl', 'white', 'ggplot', 'solar', 'space']
To set the theme:
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
Thanks heaps for the help!