Mathematica 中 Manipulate 与 Locator 结合的语法
我很难理解以下表达式的语法:
Manipulate[ Graphics[Line[{{0, 0}, p}], PlotRange -> 2], {{p, {1, 1}}, Locator}]
根据 Manipulate 文档语法如下所示:
Manipulate[expr, {u, u_min, u_max}]
Manipulate[expr, {u, u_min, u_max, du}]
Manipulate[expr, {{u, u_init}, u_min, u_max, ...}]
Manipulate[expr, {{u, u_init, u_lbl}, u_min, u_max, ...}]
Manipulate[expr, {u, {u_1, u_2,...}}]
Locator 应该像这样工作:
Locator[{x, y}]
Locator[Dynamic[pos]]
Locator[{x, y}, obj]
Locator[{x, y}, None]
我假设{{p, {1, 1}}, Locator}
映射到 Manipulate[expr, {{u, u_init}, ...}]
其中 u_init
是 {1, 1}
但随后有一个无参数 Locator
,我在其中 会期望一个最小值。
定位器在上述语法描述中扮演什么角色?
I have difficulties understanding the syntax of the following expression:
Manipulate[ Graphics[Line[{{0, 0}, p}], PlotRange -> 2], {{p, {1, 1}}, Locator}]
According to the documentation of Manipulate the syntax looks like this:
Manipulate[expr, {u, u_min, u_max}]
Manipulate[expr, {u, u_min, u_max, du}]
Manipulate[expr, {{u, u_init}, u_min, u_max, ...}]
Manipulate[expr, {{u, u_init, u_lbl}, u_min, u_max, ...}]
Manipulate[expr, {u, {u_1, u_2,...}}]
Locator should work like this:
Locator[{x, y}]
Locator[Dynamic[pos]]
Locator[{x, y}, obj]
Locator[{x, y}, None]
I assume {{p, {1, 1}}, Locator}
maps to Manipulate[expr, {{u, u_init}, ...}]
where u_init
is {1, 1}
but then there is a parameterless Locator
where I
would expect a minimum value.
What role plays the Locator in the above syntax descriptions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如
Manipulate
的文档所述(在“更多信息”框):As the documentation for
Manipulate
states (in the "More information" box):