interact variables work differently

asked 2020-10-28 20:07:48 -0600

cybervigilante gravatar image

This interact works but I'm unclear why I only need n in the body of the function, but ymax alone fails. I have to make it ymax=ymax. They should both work the same.

@interact
def _(n=(1,20),ymax=(50,200)):
    show(plot([.5*x^2,x^2,2*x^2],-n,n,legend_label=[".5*x^2","x^2","2*x^2"],aspect_ratio=.2),ymax=ymax)
edit retag flag offensive close merge delete