Colors in Databricks Notebooks Change Between Dark and Light Mode
Description:
Colors differ significantly between dark and light modes when using the lets-plot package in Databricks Notebooks. This inconsistency makes it challenging to maintain a unified visualization style.
Steps to Reproduce:
- Create any plot using
lets-plotin a Databricks Notebook. - Switch between light and dark mode in Databricks.
- Observe the changes in plot colors.
Expected Behavior: Plot colors should remain consistent regardless of the notebook theme.
Actual Behavior: Colors change depending on whether the notebook is in dark or light mode.
Environment:
lets-plotversion: 4.3.2- Databricks Notebooks (DBR 15.1)
That is surprising. As far as I know, Lets-Plot is not aware of Databricks color profiles. Most likely, some kind of glue code was added by Databricks or a third party. I'm not familiar with Databricks notebooks, but perhaps there is an option to disable this behavior.
In lets-plot colors are adjusted either via theme() or by applying a "flawor", for example: flavor_darcula.
Just as an experiment, try to set the global theme in your notebook:
LetsPlot.set_theme(flavor_darcula())
and see if this would fixate the plot colors.
Unfortunately, we don't have a "flavor" that reverts the plot colors to default values. However, we can add this option in the future if this is your intent and the trick above works.