Skip to content

px.scatter(df, ..., render_mode="webgl") fails when color column contains all NaN #4387

Open
@ChiQiao

Description

@ChiQiao

Code to reproduce the issue:

import pandas as pd
import numpy as np
import plotly.express as px

df = pd.DataFrame({"x": [0, 1], "y": [0, 1], "c": [np.nan, np.nan]})
px.scatter(df, x="x", y="y", color="c", render_mode="webgl")

Error:
image

There will be no issue for all the cases below:

  1. remder_mode="svg"
  2. "c": [None, None]
  3. "c": [np.nan, 1] # i.e., not all NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions