mathematica 中的命令完成:建议规则/选项
在当前版本的 Mathematica 中,这些键盘快捷键非常方便
Ctrl+K 完成当前命令
GraphPl -> press Ctrl+K -> GraphPlot
Ctrl+Shift+K 完成当前命令并添加可以用实际值替换的参数占位符使用 tab 键
GraphPl -> press Ctrl+Shift+K -> GraphPlot[{vi1->vj1,vi2->vj2,...}]
但是我找不到任何键盘选项来显示相关的设置/选项
例如说如果我需要使用不同的布局绘制图表,我知道我需要使用一个设置方法这些可能的设置
- “CircularEmbedding”
- “RandomEmbedding”
- “HighDimensionalEmbedding”
- “RadialDrawing”
- “SpringEmbedding”
- “SpringElectricalEmbedding”
首先有两件事
如何自动完成这些选项,是否有快捷键?
GraphPlot[sg, Method -> <what keyboard shortcut to display all possible options>]
其次,如何以编程方式生成以下 PopupMenu list
list={
"CircularEmbedding"
, "RandomEmbedding"
, "HighDimensionalEmbedding"
, "RadialDrawing"
, "SpringEmbedding"
, "SpringElectricalEmbedding"
}
Manipulate[GraphPlot[sg, Method -> m], {m, list}, ControlType -> PopupMenu]
是否有任何方法可以内省 Mathematica 函数并访问方法元数据,类似于在其他编程语言中完成的方式,例如在 Java 中使用反射?
In current version of Mathematica these keyboard shortcuts are quite handy
Ctrl+K completes current command
GraphPl -> press Ctrl+K -> GraphPlot
Ctrl+Shift+K completes current command and adds argument placeholders which could be replaced with actual values with tab key
GraphPl -> press Ctrl+Shift+K -> GraphPlot[{vi1->vj1,vi2->vj2,...}]
However I couldn't find any keyboard option to show associated settings/options
For instance Say If I need to plot a graph with different layouts, I know I need to set Method with one of these Possible settings
- "CircularEmbedding"
- "RandomEmbedding"
- "HighDimensionalEmbedding"
- "RadialDrawing"
- "SpringEmbedding"
- "SpringElectricalEmbedding"
Two things
First How to autocomplete these options , is there any shortcut key ?
GraphPlot[sg, Method -> <what keyboard shortcut to display all possible options>]
Second how to generate following PopupMenu list
programmatically
list={
"CircularEmbedding"
, "RandomEmbedding"
, "HighDimensionalEmbedding"
, "RadialDrawing"
, "SpringEmbedding"
, "SpringElectricalEmbedding"
}
Manipulate[GraphPlot[sg, Method -> m], {m, list}, ControlType -> PopupMenu]
Is there any way to introspect Mathematica functions and access method Metadata similar to the way it could be done in other programming languages, Like using reflection in Java ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不相信有任何包含的函数可以自动完成字符串。除了搜索帮助文件之外,我也不记得查看特定选项的所有有效设置的方法。
您可以使用选项检查器设置
InputAliases
和InputAutoReplacements
加快输入速度,允许通过 Esctxt
Esc 输入 或txt
空格。I don't believe there is any included function to auto-complete a string. I also cannot recall a way to view all valid settings for a particular option, other than searching the help files.
You can expedite input with the Options Inspector settings
InputAliases
andInputAutoReplacements
, allowing entry by Esctxt
Esc ortxt
Space.草案:正在进行中...
这是迄今为止我能达到的最接近的版本,尽管它需要大量的增强,添加它是因为它希望从社区获得一些想法。如果有人可以帮助进一步增强它,或者提出任何想法,我们将不胜感激。
Draft : work in progress ...
This is the nearest I could reach so far, though It needs loads of enhancement, Adding it as it is hoping to get some Ideas from community. If anyone could help enhance it further, Or suggest any Idea, It would really be appreciated.