# Express scatter animations giving inconsistent behavior

**URL:** <https://community.plotly.com/t/express-scatter-animations-giving-inconsistent-behavior/32592>\
**Category:** 📊 Plotly Python\
**Created:** [December 14, 2019, 7:58pm UTC](https://community.plotly.com/t/express-scatter-animations-giving-inconsistent-behavior/32592 "2019-12-14T19:58:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbibee](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mbibee](https://community.plotly.com/u/mbibee)\
**Post date:** [December 14, 2019, 7:58pm UTC](https://community.plotly.com/t/express-scatter-animations-giving-inconsistent-behavior/32592/1 "2019-12-14T19:58:56Z")

</div>

I have a moderate sized data set of x-y scatter objects that I have placed into groups and sets. Plotting using facet\_row, facet\_col was starting to make for tiny little subplots due to the large number of facet\_rows. I wanted to try animating the data to get a slider make it easier to visualize. The issue is the slider reaches a point where plots stop updating. To illustrate I have defined a simple data set:

```
data = {
    'x':[0, 1, 2, 0, 1, 2],
    'y':[0, 1, 4, .5, 1.5, 18],
    'g':['A','A','A','B','B','B'],
    's':[10, 10, 10, 20, 20, 20]

```

}  
data = pd.DataFrame(data)  
fig = px.scatter(data, x=‘x’, y=‘y’, facet\_col=‘g’, animation\_frame=‘s’)  
fig.show()

The above will give you a slider that uses the ‘s’ column but when you pull it to 20 and back to 10 the group “A” scatter trace is just gone. If I skip trying to animate and use facet\_row=‘s’ then I get the plot I expect but this approach doesn’t scale will for many different values of s.

```
fig = px.scatter(data, x='x', y='y', facet_col='g', facet_row='s')
fig.show()

```

If I pad the data to force both ‘A’ and ‘B’ groups to have a least a single NaN for sets 10,20 then the animation appears to work but I would rather not have manually force data points in. I really like the terse compact syntax for adding the animation and would like to use this approach if possible.
