IPython 2.0 introduced interactive widgets, which are basically:
Thanks to fantastic work by a Google Summer of Code student, Shashi Gowda, the same features are accessible from a Julia interface.
using Interact
@manipulate for n in 1:100
rand(n,n)
end
50x50 Array{Float64,2}: 0.0783651 0.659912 0.493106 … 0.00843273 0.390298 0.371666 0.777267 0.693219 0.192893 0.616208 0.578022 0.557077 0.943229 0.727943 0.476202 0.729187 0.802135 0.247574 0.72757 0.524887 0.353149 0.264238 0.158479 0.636858 0.34325 0.138554 0.192981 0.280109 0.227542 0.249223 0.938034 0.655234 0.610706 … 0.546524 0.932167 0.965825 0.767394 0.578772 0.188317 0.945736 0.546516 0.377502 0.763565 0.496797 0.157069 0.399278 0.964966 0.997327 0.954463 0.356982 0.822894 0.219752 0.651061 0.494788 0.138325 0.944702 0.115443 0.447035 0.576238 0.608754 0.53938 0.0787142 0.922149 … 0.792806 0.165075 0.679461 0.374026 0.448081 0.856923 0.84534 0.721902 0.0439824 0.226981 0.869573 0.88941 0.758137 0.423605 0.299644 ⋮ ⋱ 0.743885 0.0999547 0.19466 0.323379 0.630683 0.0714383 0.827333 0.462604 0.797415 0.737597 0.150168 0.240378 0.869538 0.328771 0.677618 … 0.410014 0.418106 0.643248 0.752797 0.194726 0.292419 0.928435 0.378404 0.718977 0.405323 0.275025 0.440214 0.782656 0.00042197 0.753483 0.402975 0.412902 0.660082 0.925285 0.214545 0.946338 0.513647 0.218183 0.404153 0.375432 0.434286 0.541837 0.314132 0.25124 0.659074 … 0.784845 0.694182 0.205578 0.554015 0.229091 0.639937 0.631327 0.325274 0.68994 0.132268 0.982651 0.056666 0.56603 0.767409 0.741117 0.70252 0.716309 0.174637 0.0962708 0.626505 0.49941 0.361128 0.118059 0.171592 0.835711 0.312115 0.109988
using Color
@manipulate for r in 0:0.1:1, g in 0:0.1:1, b in 0:0.1:1, n in 1:100
linspace(RGB(0,0,0), RGB(r,g,b), n)
end
using PyPlot
INFO: Loading help data...
x = linspace(0,10,1000)
f = figure()
@manipulate for α = 1:0.1:4, β = 1:0.1:4, leg="a funny plot"
withfig(f) do
plot(x, cos(α*x + sin(β*x)))
legend([leg])
end
end
Figure(PyObject <matplotlib.figure.Figure object at 0x111ad0f10>)
using SymPy
x = sym"x"
@manipulate for n=0:20
latex(SymPy.diff(sin(x^2), x, n))
end
Figure(PyObject <matplotlib.figure.Figure object at 0x12408b590>)
Warning: imported binding for transpose overwritten in module __anon__