plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.4k stars 2.56k forks source link

scatter_matrix is incorrect when using color and non-sorted index #3577

Open shane-kercheval opened 2 years ago

shane-kercheval commented 2 years ago

related to https://github.com/plotly/plotly.py/issues/3576

df = pd.DataFrame({
        'A': [1, 2, 3, 4],
        'B': [1, 2, 3, 4],
        'C': [1, 2, 3, 4],
    },
    index=[3, 2, 1, 0]
)
px.scatter_matrix(df)
px.scatter_matrix(df, color='C')

px.scatter_matrix(df) produces:

Screen Shot 2022-01-31 at 9 51 05 AM

px.scatter_matrix(df, color='C') produces:

Screen Shot 2022-01-31 at 9 49 30 AM

MarcoGorelli commented 3 days ago

Hi @shane-kercheval

Is this your expected output

Image

?

shane-kercheval commented 3 days ago

Yes, thank you!