Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

interact variables work differently

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)