import nbinteract as nbi
import numpy as np
def x_fn(n): 
    return np.arange(n)

def y_fn(xs, offset):
    return xs + offset


options = {
    'title': 'Bar chart',
    'xlabel': 'Number of bars (n)',
    'ylabel': 'Offset  value',
    'animation_duration': 500,
    'aspect_ratio': 1.778,
    'ylim': (0, 20)
}

layouts = {
    'plot_height': '480px',
    'plot_width': '800px',
}

bar_chart = nbi.bar(
    x_fn,
    y_fn,
    n=(3, 10),
    offset=(1, 10),
    options=options,
    layouts=layouts
)

bar_chart