Skip to content

Support color scale from data #38

Description

@thomas-saigre
def plot_scatter_3d():
    t = np.linspace(0, 20, 100)
    x, y, z = np.cos(t), np.sin(t), t

    fig = go.Figure(data=[go.Scatter3d(
        x=x,
        y=y,
        z=z,
        mode="markers",
        marker=dict(
            size=12,
            color=z,                # set color to an array/list of desired values
            colorscale='Viridis',   # choose a colorscale
            opacity=0.8,
            symbol="diamond"
        ),
    )])
    fig.update_layout(margin=dict(l=0, r=0, b=0, t=0))
    return fig

with this code, the color of the trace is an array [ 0. 0.2020202 0.4040404 0.60606061 0.80808081 1.01010101 1.21212121 1.41414141 1.61616162 1.81818182... which is not supported yet.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions