In [1]:
import numpy as np
import nbinteract as ni
In [4]:
x=np.r_[:10:0.3]
a,b=3,2
y=a*x+b+np.random.normal(size=len(x))
opts = {'xlim': (0, 9), 'ylim': (0, 11), 'animation_duration': 250}
ni.scatter(x,y,options=opts)
In [7]:
def x_values(max): return np.arange(0, max)
def y_values(xs, sd):
return xs + np.random.normal(0, scale=sd, size=len(xs))
opts = {'xlim': (0, 50), 'ylim': (0, 55), 'animation_duration': 250}
ni.line(x_values, y_values, max=(10, 50), sd=(1, 10), options=opts)
#Show Widgets
In [ ]: