def add_button(figure):
    """Adds the pause-play button for animation"""
    figure['layout']['updatemenus'] = [{'buttons': [{'args': [None, {
        'frame': {'duration': 500, 'redraw': False}, 'fromcurrent': True,
        'transition': {'duration': 300, 'easing': 'quadratic-in-out'}}],
        'label': 'Play', 'method': 'animate'}, {'args': [[None], {'frame':
        {'duration': 0, 'redraw': False}, 'mode': 'immediate', 'transition':
        {'duration': 0}}], 'label': 'Pause', 'method': 'animate'}],
        'direction': 'left', 'pad': {'r': 10, 't': 87}, 'showactive': False,
        'type': 'buttons', 'x': 0.1, 'xanchor': 'right', 'y': 0, 'yanchor':
        'top'}]
