Skip to content

*_map should be aware of category_orders and "leave room" for missing categories #3048

Closed
@nicolaskruchten

Description

@nicolaskruchten

In the following examples, all markers of the same letter should have the same color, except in the last case, the a markers would have the specified color from color_discrete_map.

px.scatter(... color=["a", "c", "b", "d"], category_orders=dict(color=["a", "b", "c", "d"]))
px.scatter(... color=["a", "c", "a", "c"], category_orders=dict(color=["a", "b", "c", "d"]))
px.scatter(... color=["b", "d", "b", "d"], category_orders=dict(color=["a", "b", "c", "d"]))
px.scatter(... color=["a", "c", "b", "d"], category_orders=dict(color=["a", "b", "c", "d"]), 
    color_discrete_map=dict(a="red"))

This is technically a breaking change, so we'll release this in v5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions