Skip to content

fillgradient doesn't work when renderer=vscode is used on notebook #4554

Closed
@acmoudleysa

Description

@acmoudleysa

According to the documentation, the latest version 5.20 includes fillgradient parameter for go.Scatter. However it only works when renderer is set to browser. Here goes the code (I am using the example provided in the documentation itself).

import plotly.graph_objects as go

fig = go.Figure(
    [
        go.Scatter(
            x=[1, 2, 3, 4],
            y=[3, 4, 8, 3],
            fill=None,
            mode="lines",
            line_color="darkblue",
        ),
        go.Scatter(
            x=[1, 2, 3, 4],
            y=[1, 6, 2, 6],
            fill="tonexty",
            mode="lines",
            line_color="darkblue",
            fillgradient=dict(
                type="horizontal",
                colorscale=[(0.0, "darkblue"), (0.5, "royalblue"), (1.0, "cyan")],
            ),
        ),
    ]
)

fig.show(renderer='vscode')

This doesn't work. But if you do fig.show(renderer='browser'), it works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions