I have a simple widget that modifies a plot, here is the definition:
#Plot function
def plf(x,lm,ls):
plt.plot(x[lm:ls],np.sin(x)[lm:ls])
this function takes a list x an plot sin(x), lm and ls controls the number of data that is ploted, the problem is when i try to plot a determinated list of data, for example
list = [1,2,3,4,5,6,7,8,9]
and if i try
interact(plf,x=list,lm=(0,max(x)//2,1),ls=(max(x)//2,max(x),1))
throws me the error:
NameError: name 'x' is not defined
so, how can i define x so it can be any list that i want?