Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colors in Databricks Notebooks Change Between Dark and Light Mode #1100

Open
sergiocalde94 opened this issue May 10, 2024 · 1 comment
Open

Comments

@sergiocalde94
Copy link

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:

  1. Create any plot using lets-plot in a Databricks Notebook.
  2. Switch between light and dark mode in Databricks.
  3. 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-plot version: 4.3.2
  • Databricks Notebooks (DBR 15.1)
@alshan
Copy link
Collaborator

alshan commented May 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants