Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The color of Scattergl points are missing when using animation #4564

Open
xuxiaoxxxx opened this issue Apr 1, 2024 · 2 comments
Open

The color of Scattergl points are missing when using animation #4564

xuxiaoxxxx opened this issue Apr 1, 2024 · 2 comments

Comments

@xuxiaoxxxx
Copy link

xuxiaoxxxx commented Apr 1, 2024

import plotly.graph_objects as go

fig = go.Figure(
    data=[go.Scattergl(x=[0, 1], y=[0, 1])],
    layout=go.Layout(
        xaxis=dict(range=[0, 5], autorange=False),
        yaxis=dict(range=[0, 5], autorange=False),
        title="Start Title",
        updatemenus=[dict(
            type="buttons",
            buttons=[dict(label="Play",
                          method="animate",
                          args=[None])])]
    ),
    frames=[go.Frame(data=[go.Scattergl(x=[1, 2], y=[1, 2])]),
            go.Frame(data=[go.Scattergl(x=[1, 4], y=[1, 4])]),
            go.Frame(data=[go.Scattergl(x=[3, 4], y=[3, 4])],
                     layout=go.Layout(title_text="End Title"))]
)
fig.update_layout(showlegend=False)
fig.show()

the visualization is shown as below:
(https://github.com/plotly/plotly.py/assets/55653936/29679f73-06e7-43dd-80ae-1c7d7636f29d)

When I execute the above code, only the first frame line segment has normal color, and the other frame line segments have no color.

@Coding-with-Adam
Copy link
Contributor

Coding-with-Adam commented Apr 5, 2024

codepen to replicate the error in js.

Potentially tied to #3243

Thanks for reporting @xuxiaoxxxx

@felipecordero
Copy link

felipecordero commented May 26, 2024

Hi everyone.
I can confirm that apparently it is not possible to animate Scattergl plots. After changing my plots to Scatter, everything works as expected. The need for using Scattergl plots is related to a "background plot (with many elements)" I need to use behind the points that change over the time. By the way, I am declaring the background plots in every Frame in the data parameter. If there is another approach for this, I will appreciate it a lot. Thanks!

output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants