Skip to content

Plot by coloring incorrect in some cases #407

@jnumainville

Description

@jnumainville

Description

In some cases, using a plot by with a color_discrete_map does not work correctly

Steps to reproduce

from deephaven import time_table
from deephaven.plot import express as dx

t = time_table("PT1s").update(["y=Math.random()", "Chnge = (y > 0.5) ? `LimeGreen` : `Red`"])
p1 = dx.area(t, x="Timestamp", y="y", by="Chnge")
p2 = dx.area(t, x="Timestamp", y="y", by="Chnge", color_discrete_map={"Red": "Red", "LimeGreen": "LimeGreen"})
p3 = dx.area(t, x="Timestamp", y="y", color="Chnge", color_discrete_map={"Red": "Red", "LimeGreen": "LimeGreen"})

Expected results

p2 and p3 should be identical

Actual results

p2 loses it's plot by completely, although p3 is as expected
Note that p1 is as expected as well, so adding the color_discrete_map is breaking it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions