[Python] plotly animation disable auto play

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    Is it possible to disable the auto play when saving an animated plot created with plotly?

    import plotly.express as px
    df = px.data.gapminder()
    px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
    size="pop", color="continent", hover_name="country",
    log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90]).write_html('anim.html')


    When I open anim.html, the animation starts automatically. I can stop it by pressing stop, but would like to change the default behavior.

    Continue reading...

Compartilhe esta Página