Skip to content

plotly.express.scattermatrix displays no color if supplied a pandas.DataFrame with a DataTime index #4917

@Noskario

Description

@Noskario

The color does not get diplayed when using a DataFrame with a DateTime index.

Have a look at the following example:

import pandas as pd
import plotly.express as px
df = pd.DataFrame({
        "x":[1,2,3,4],
        "y":[10,20,10,20],
        "z":[-1,-2,-3,-4],
        "color":[1,2,3,4]
    })
df.index = pd.DatetimeIndex(["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00", "3/1/2020 10:00:00+00:00", "4/1/2020 11:00:00+00:00"])
px.scatter_matrix(df, color = "color")

Image

There are no problems when you comment out the line df.index = ....

Maybe this issue is related to #4788

Metadata

Metadata

Assignees

Labels

P1needed for current cyclebugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions