def opacity_button(data_ix, mean_ix):
    """Configures opacity drop down menu.

    Args:
        data_ix: iterable with data index at 1 and mean index at 0.
        mean_ix: iterable with data index at 0 and mean index at 1.

    Returns:
        opacity_menu: config dict for layout
    """

    reset_opac = [1] * len(data_ix)
    data_reduce = [a+b for a,b in zip([.5*x for x in data_ix], mean_ix)]
    mean_reduce = [a+b for a,b in zip([.5*x for x in mean_ix], data_ix)]

    opacity_menu = list([
        dict(
            font=dict(family='monospace', size=12),
            showactive = True,
            xanchor = 'auto',
            direction = 'down',
            x = 0,
            y = 1,
            active=0,
            buttons=list([
            dict(label = 'Reset opacity',
                 method = 'update',
                 args = [{'opacity': reset_opac}]),
            dict(label = 'Data opacity 0%',
                 method = 'update',
                 args = [{'opacity': mean_ix}]),
            dict(label = 'Data opacity 50%',
                 method = 'update',
                 args = [{'opacity': data_reduce}]),
            dict(label = 'Mean opacity 0%',
                 method = 'update',
                 args = [{'opacity': data_ix}]),
            dict(label = 'Mean opacity 50%',
                 method = 'update',
                 args = [{'opacity': mean_reduce}])
            ])
        )
    ])
    return opacity_menu