Skip to content

Most markers not visible unless chart is double-clicked with plotly.express animation_frame #1674

@eliasdabbas

Description

@eliasdabbas

Creating an animated plotly.express chart using animation_frame works fine, but I realized that when selecting a certain value on the slider, most markers are not visible. It all works fine when I double click on the chart.

plotly==4.0.0
pandas==0.24.2

import random
import plotly.express as xp
import pandas as pd
import plotly

df = pd.DataFrame({
    'date': pd.date_range('2019-01-01', '2019-12-31'),
    'number': random.choices(range(1,200), k=365)
    
})
df['month'] = df['date'].dt.month
df.head()

	date	      number	 month
0	2019-01-01	152	1
1	2019-01-02	127	1
2	2019-01-03	39	1
3	2019-01-04	195	1
4	2019-01-05	69	1

xp.scatter(df, x='date', y='number', animation_frame='month')

Selecting month 6 gives the following empty chart:

Screen Shot 2019-07-20 at 10 55 01 PM

After double-clicking the chart it looks fine:

Screen Shot 2019-07-20 at 10 55 10 PM

Any idea what might be causing that?
Thanks!

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