plotly / plotly/plotly.py

Error in plotly express scatter with continuous_color_scale and marginal_x

Open
#2,059 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Hello

i am logging this as i think this might be a bug. I found while building a Dash app but the same issue arises in a a jupyter notebook.

import plotly.express as px
df = px.data.iris()

below, it works as expected:

fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",color_continuous_scale='Viridis')
fig

so is the following

fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",marginal_x='box')
fig

But the following expression breaks down

fig = px.scatter(df, x="sepal_width", y="sepal_length", color="sepal_length",marginal_x='box',color_continuous_scale='Viridis')
fig

image

it looks like box marker is using 'V' of Viridis in the color_continuous_scale.

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Python examples in a Jupyter notebook and compare the working cases with the combination of marginal_x='box' and color_continuous_scale='Viridis'. Trace how that combination builds the scatter and marginal box traces; done means the plot renders without the box marker using an incorrect color from the continuous scale.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.