Skip to content

Coloring by boolean column type does not work #2121

Description

@WillKoehrsen

When trying to color a scatter plot by a bool column datatype, the colors do not show:

(see attached file for data)

grouped.dtypes

mean_ape            float64
measurement_type     object
note                 object
parameters           object
n_estimators          int64
max_depth             int64
bootstrap              bool
max_features        float64

fig = px.scatter(
    grouped,
    x="n_estimators",
    y="mean_ape",
    facet_row="measurement_type",
    color="bootstrap",
    title="Error vs Number of Estimators Colored by Bootstrap",
    height=1000, width=1600
)

Screen Shot 2019-06-17 at 08 52 13 EDT

However, if I convert the bool column to a str, then the colors correctly appear:

new_grouped = grouped.copy()
new_grouped['bootstrap'] = new_grouped['bootstrap'].astype(str)

fig = px.scatter(
    new_grouped,
    x="n_estimators",
    y="mean_ape",
    facet_row="measurement_type",
    color="bootstrap",
    title="Error vs Number of Estimators Colored by Bootstrap",
    height=1000, width=1600
)

Screen Shot 2019-06-17 at 08 53 13 EDT

grouped.csv.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions