# Slider does not update frame on plot

**URL:** https://community.plotly.com/t/slider-does-not-update-frame-on-plot/29023
**Category:** 📊 Plotly Python
**Created:** [September 20, 2019, 6:58pm UTC](https://community.plotly.com/t/slider-does-not-update-frame-on-plot/29023 "2019-09-20T18:58:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jalooo555](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jalooo555/32/7948_2.png) [@jalooo555](https://community.plotly.com/u/jalooo555)
#### Post date: [September 20, 2019, 6:58pm UTC](https://community.plotly.com/t/slider-does-not-update-frame-on-plot/29023/1 "2019-09-20T18:58:21Z")

</div>

Hello, I’m trying to update the plotted frames based on the slider. Even though the slider updates, the data on the graph doesn’t. Any ideas?

```auto
  # Create figure
  figure = {
    'data': [{
      'type': 'bar',
      'x': list(srt.np.linspace(0, len(arr), num=len(arr))),
      'y': arr
    }],
    'layout': {
      'xaxis': {
        'title': 'X',
        'gridcolor': '#FFFFFF',
        'linecolor': '#000',
        'linewidth': 0,
        'zeroline': False,
        'autorange': True
      },
      'yaxis': {
        'title': 'Y',
        'gridcolor': '#FFFFFF',
        'linecolor': '#000',
        'linewidth': 0,
        'autorange': True
      },
      'title': method,
      'updatemenus': [{
        'type': 'buttons',
        'buttons': [{
          'label': 'Play',
          'method': 'animate',
          'args': [None, {
            'frame': {
              'duration': 10,
              'redraw': True
            },
            'fromcurrent': True,
            'transition': {
              'duration': 30,
              'easing': 'quad-in-out'
            }
          }]
        }]
      }]
    },
    'frames': []   
  }

  # Add slider
  sliders = [dict(steps=[
    dict(method='animate', args=[[k], dict(
      mode='e', frame = dict(duration=50, redraw=False), transition=dict(duration=0)
      )],
      label=k) for k in range(len(frames))],
      transition=dict(duration=30),
      x=0,
      y=0,
      len=1.0,
      active=0,
      currentvalue=dict(font=dict(size=12), 
                        prefix='Step: ', 
                        visible=True, 
                        xanchor= 'center')
    )]
  
  figure["layout"]["sliders"] = sliders

  # Update frame
  for k in range(len(frames)):
    frame = {"data": {
      'type': 'bar',
      "x": list(srt.np.linspace(0, len(arr), num=len(arr))),
      "y": frames[k]
    }}
    figure["frames"].append(frame)

  fig = go.Figure(figure)

```

---

<div class="post-metadata">

### Author: ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)
#### Post date: [September 24, 2019, 1:38am UTC](https://community.plotly.com/t/slider-does-not-update-frame-on-plot/29023/2 "2019-09-24T01:38:06Z")

</div>

Could you please provide a standalone code (ie with all variables defined, eg synthetic variables, and packages imported)? It would make it easier to reproduce your problem.
