Skip to content

Plotly express with multiple dataframe variables and color mapping looses variable mapping #2901

@rjvtww

Description

@rjvtww

I am using plotly express by passing y variables as a list of dataframe names, which works perfectly fine and gives the following output:

px.scatter(df, x=df.index, y=yvars, title='Scatter Matrix')
plot1

The problem is if I add a color map variable, all the y variables are passed together, and I can no longer tell/select the plotted variables:

px.scatter(df, x=df.index, y=yvars, title='Scatter Matrix', color=categorychoice)
plot2

I made sure it was the case by forcing the legend view, as seen in the screenshot.

This is problematic of course as I lose the variables information and its all just one single var.

Thanks in advance!

Best,

Rodolfo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions