通过 Manipulate 命令可以交互式地实时查看改变参数会发生什么:
In[1]:= | ![]()
⨯
Manipulate[Plot[Sin[f x], {x, -3, 3}, Filling -> Axis], {f, 1, 5}] |
Out[1]= | ![]() |
一个单独的 Manipulate 命令中可以有多个控件,Wolfram 语言将自动选择控件最合适的布局:
In[1]:= | ![]()
⨯
Manipulate[Plot[Sin[f*x + p], {x, -3, 3}, Filling -> fill, PlotStyle -> color], {f, 1, 5}, {p, 3, 9}, {fill, {Bottom, Top, Axis}}, {color, Red}] |
Out[1]= | ![]() |
Wolfram 语言中的任意表达式都可被操控,包括非图形表达式:
In[1]:= | ![]()
⨯
Manipulate[Expand[(a + b)^n], {n, 1, 20, 1}] |
Out[1]= | ![]() |
快速参考:动态可视化 »