mathematica 中的命令完成:建议规则/选项

发布于 2024-12-22 13:11:01 字数 1168 浏览 3 评论 0原文

在当前版本的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小帐篷 2024-12-29 13:11:01

我不相信有任何包含的函数可以自动完成字符串。除了搜索帮助文件之外,我也不记得查看特定选项的所有有效设置的方法。

您可以使用选项检查器设置 InputAliasesInputAutoReplacements 加快输入速度,允许通过 EsctxtEsc 输入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 and InputAutoReplacements, allowing entry by EsctxtEsc or txtSpace.

述情 2024-12-29 13:11:01

草案:正在进行中...

这是迄今为止我能达到的最接近的版本,尽管它需要大量的增强,添加它是因为它希望从社区获得一些想法。如果有人可以帮助进一步增强它,或者提出任何想法,我们将不胜感激。

ruleOfRule[list_] := Map[Rule[#, #] &, list];
Manipulate[
 GraphPlot @@ {{"A" -> "B", "B" -> "C", "C" -> "A"}, 
   options}, {{options, {}}, ruleOfRule[Options[GraphPlot]]}, 
 ControlType -> CheckboxBar]

选项

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.

ruleOfRule[list_] := Map[Rule[#, #] &, list];
Manipulate[
 GraphPlot @@ {{"A" -> "B", "B" -> "C", "C" -> "A"}, 
   options}, {{options, {}}, ruleOfRule[Options[GraphPlot]]}, 
 ControlType -> CheckboxBar]

options

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文