RulePlot
更多信息和选项
- 可能的计算系统 sys 包括:
-
CellularAutomaton[spec] 元胞自动机 TuringMachine[spec] 图灵机 SubstitutionSystem[spec] 替代系统 BooleanFunction[spec] 布尔函数 - TuringMachine[{rule,s,k}] 可用于指定图灵机,其中 rule 不唯一指定 s k 种可能配置中每一种的转换,但仍然会假设 s 个头部状态和 k 种纸带颜色.
- RulePlot 可用于一维和二维系统.
- 选项包括:
-
Appearance Automatic 整体外观 ColorRules Automatic 用于根据数值确定颜色的规则 Frame Automatic 是否在规则外面画上边框 FrameStyle Automatic 边框的样式 Mesh Automatic 是否画上网格 MeshStyle Automatic 网格的样式 PlotLegends None 包含的图例 PlotMarkers Automatic 图灵机的标记等 PlotTheme $PlotTheme 规则图的整体主题 Spacings Automatic 纵向和横向间距 - 可能的外观元素包括:
-

"Contiguous" 状态间没有间距 
"Stacked" 状态间加上小间距 
"Arrow" 状态间加上箭头 
"Squares" 正方形单元 
"Bricks" 砖形单元 
"Hexagons" 六边形单元 
"Simplified" 简化的规则实例 
"Short" 显示简少的规则 - 可能的图例形式包括:
-
"Icon" 用图标作为图例 "Text" 用文字作为图例 expr 任意图例 - 在形式 RulePlot[sys,evol] 中,通常忽略特殊的规则;只使用隐式或显式的颜色数量、状态数量等规范.
范例
打开所有单元 关闭所有单元基本范例 (5)
RulePlot[CellularAutomaton[30]]RulePlot[CellularAutomaton[30], {{1}, 0}, 10]RulePlot[CellularAutomaton[30], {{1}, 0}, 10, PlotLegends -> "Icon"]RulePlot[TuringMachine[{596440, 2, 3}], {1, {{}, 0}}, 20]RulePlot[TuringMachine[{596440, 2, 3}]]evolution = TuringMachine[{596440, 2, 3}, {1, {{}, 0}}, 5]用 RulePlot 显示过程,用规则信息确定绘图形式:
RulePlot[TuringMachine[{596440, 2, 3}], evolution]RulePlot[SubstitutionSystem[{1 -> {1, 0}, 0 -> {0, 1}}], Appearance -> "Arrow"]范围 (42)
系统规则 (31)
CellularAutomaton (11)
RulePlot[CellularAutomaton[90]]RulePlot[CellularAutomaton[{679458, 3}]]RulePlot[CellularAutomaton[{1234, 2, 2}]]RulePlot[CellularAutomaton[{9, 2, 3 / 2}]]RulePlot[CellularAutomaton[{1599, {3, 1}}]]RulePlot[CellularAutomaton[{1000, {3, {3, 1, 3}}}]]RulePlot[CellularAutomaton[{23571113171923, 2, {1, 1}}]]RulePlot[CellularAutomaton[{20, {2, {{0, 1, 0}, {1, 1, 1}, {0, 1, 0}}}, {1, 1}}]]RulePlot[CellularAutomaton[{111, {2, {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}}, {1, 1}}]]RulePlot[CellularAutomaton[{222, {2, {{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}}, {1, 1}}]]RulePlot[CellularAutomaton[<|"RuleNumber" -> 30|>]]RulePlot[CellularAutomaton[<|"TotalisticCode" -> 14, "Dimension" -> 2|>]]RulePlot[CellularAutomaton[<|"OuterTotalisticCode" -> 110, "Dimension" -> 2, "Neighborhood" -> 5|>]]TuringMachine (8)
RulePlot[TuringMachine[2506]]RulePlot[TuringMachine[{600720, 3}]]RulePlot[TuringMachine[{596440, 2, 3}]]RulePlot[TuringMachine[{{1, 2} -> {1, 1, -1}, {1, 1} -> {1, 2, -1}, {1, 0} -> {2, 1, 1}, {2, 2} -> {1, 0, 1}, {2, 1} -> {2, 2, 1}, {2, 0} -> {1, 2, -1}}]]rules = {{1, 1} -> {2, 0, -1}, {1, 0} -> {2, 1, 1}, {2, 1} -> {1, 0, 1}, {2, 0} -> {1, 1, -1}};RulePlot[TuringMachine[{rules, 2, 2}]]RulePlot[TuringMachine[{rules, 3, 3}]]RulePlot[TuringMachine[{{1, 1} -> {1, 0, -1}, {1, 0} -> {1, 0, -1}}]]RulePlot[TuringMachine[{{{1, 1} -> {1, 0, -1}, {1, 0} -> {1, 0, -1}}, 2, 2}]]未充分指定的图灵机不具有适用于所有 s k 输入配置的规则:
RulePlot[TuringMachine[{{1, 0} -> {2, 1, 1}, {2, 1} -> {1, 0, 1}, {2, 0} -> {1, 1, -1}}]]RulePlot[TuringMachine[{{1, 0} -> {1, 0, -1}, {1, 0} -> {1, 0, 1}}]]SubstitutionSystem (8)
RulePlot[SubstitutionSystem[{"a" -> "ba", "b" -> "aa"}]]RulePlot[SubstitutionSystem[{"a" -> "ba", "b" -> "da", "c" -> "ca", "d" -> "bc"}]]RulePlot[SubstitutionSystem[{"aa" -> "bc", "ab" -> "aa", "ba" -> "ab", "cb" -> "ac", "cc" -> "ba"}]]RulePlot[SubstitutionSystem[{"aa" -> "ba", "ab" -> "c", "bac" -> "aba", "bba" -> "b", "c" -> "bc"}]]RulePlot[SubstitutionSystem[{0 -> {0, 1}, 1 -> {0, 0}}]]RulePlot[SubstitutionSystem[{0 -> {0, 1}, 1 -> {2, 3}, 2 -> {1, 2}, 3 -> {2, 0}}]]RulePlot[SubstitutionSystem[{0 -> {0, 1, 3}, 1 -> {2, 3}, 2 -> {1}, 3 -> {2, 0}}]]RulePlot[SubstitutionSystem[{0 -> {{0, 0}, {0, 0}}, 1 -> {{0, 1}, {1, 1}}}]]RulePlot[SubstitutionSystem[{0 -> {{0, 0, 0}, {0, 0, 0}}, 1 -> {{1, 0, 0}, {1, 1, 1}}}]]BooleanFunction (4)
RulePlot[BooleanFunction[8, 2]]RulePlot[BooleanFunction[251084, 5]]RulePlot[BooleanFunction[{True, True, True, False, False, False, False, False}]]RulePlot[BooleanFunction[{
{True, True, True} -> 0, {True, True, False} -> 0,
{True, False, True} -> 0, {True, False, False} -> 1,
{False, True, True} -> 0, {False, True, False} -> 0,
{False, False, True} -> 1, {False, False, False} -> 1
}]]系统演化 (11)
CellularAutomaton (5)
RulePlot[CellularAutomaton[30], {0, 0, 1, 1, 1, 0, 0}, 10]RulePlot[CellularAutomaton[30], {{1}, 0}, 50]RulePlot[CellularAutomaton[{679458, 3}], {{1}, 0}, 120]RulePlot[CellularAutomaton[{679458, 3}], {{1}, {0, 1, 1, 0}}, 120]RulePlot[CellularAutomaton[{2049, {3, 1}}], {{1}, 0}, 100]RulePlot[CellularAutomaton[{50010, {3, {3, 1, 3}}}], {{1}, 0}, 100]RulePlot[CellularAutomaton[<|"RuleNumber" -> 23898, "Range" -> 3 / 2|>], {{1}, 0}, 80]RulePlot[CellularAutomaton[<|"TotalisticCode" -> 1599, "Colors" -> 3|>], {{1}, 0}, 200]TuringMachine (6)
RulePlot[TuringMachine[2506], {1, {0, 0, 0, 0}}, 20]RulePlot[TuringMachine[2506], {1, {{}, 0}}, 20]RulePlot[TuringMachine[{956440, 3}], {1, {{}, 0}}, 20]RulePlot[TuringMachine[{956440, 3}], {1, {{1}, 0}}, 20]RulePlot[TuringMachine[{596440, 2, 3}], {1, {{}, 0}}, 20]RulePlot[TuringMachine[{596440, 2, 3}], {2, {{}, 0}}, 20]由规则指定的图灵机的演进,以重复的 021 块为背景开始推演:
RulePlot[TuringMachine[{
{1, 0} -> {1, 2, 1}, {1, 1} -> {1, 2, 1}, {1, 2} -> {2, 0, -1},
{2, 0} -> {2, 1, -1}, {2, 1} -> {1, 2, 1}, {2, 2} -> {2, 0, -1}
}], {1, {{}, {0, 2, 1}}}, 50]RulePlot[TuringMachine[{{1, 0} -> {1, 0, -1}, {1, 0} -> {1, 0, 1}}], {1, {{}, 0}}, 10, PlotLegends -> "Icon"]RulePlot[TuringMachine[{{1, 0} -> {1, 0, 1}, {1, 0} -> {1, 0, -1}}], {1, {{}, 0}}, 10, PlotLegends -> "Icon"]未充分指定的图灵机不具有适用于所有 s k 输入配置的规则:
RulePlot[TuringMachine[{{1, 0} -> {2, 1, 1}, {2, 1} -> {1, 0, 1}, {2, 0} -> {1, 1, -1}}], {1, {{}, 0}}, 10]RulePlot[TuringMachine[{{1, 1} -> {2, 0, -1}, {1, 0} -> {2, 1, 1}, {2, 1} -> {1, 0, 1}, {2, 0} -> {1, 1, -1}}], {1, {{}, 0}}, 10]选项 (19)
Appearance (4)
RulePlot[CellularAutomaton[{9, 2, 1 / 2}], Appearance -> "Hexagons"]RulePlot[CellularAutomaton[{9, 2, 1 / 2}], Appearance -> "Bricks"]有时获取简单的结果显示原胞的值没关系:
RulePlot[CellularAutomaton[30], Appearance -> "Simplified"]RulePlot[CellularAutomaton[{31469, 5}], Appearance -> "Short"]ColorRules (1)
FrameStyle (2)
Mesh (1)
MeshStyle (2)
PlotLegends (3)
RulePlot[CellularAutomaton[30], PlotLegends -> "Text"]RulePlot[CellularAutomaton[30], {{1}, 0}, 20, PlotLegends -> "Icon"]RulePlot[CellularAutomaton[30], {{1}, 0}, 100, PlotLegends -> Placed[Text["complex behavior"], Below]]PlotMarkers (2)
PlotTheme (2)
RulePlot[CellularAutomaton[30], PlotTheme -> "Web"]RulePlot[CellularAutomaton[30], PlotTheme -> "Web", Mesh -> False]RulePlot[TuringMachine[{
{1, 0} -> {1, 2, 1}, {1, 1} -> {1, 2, 1}, {1, 2} -> {2, 0, -1},
{2, 0} -> {2, 1, -1}, {2, 1} -> {1, 2, 1}, {2, 2} -> {2, 0, -1},
{3, 0} -> {5, 2, -1}, {3, 1} -> {3, 2, 1}, {3, 2} -> {3, 1, 1},
{4, 0} -> {5, 0, -1}, {4, 1} -> {4, 1, 1}, {4, 2} -> {4, 0, 1},
{5, 0} -> {5, 1, 0}, {5, 1} -> {5, 2, -1}, {5, 2} -> {5, 0, -1},
{6, 0} -> {3, 2, 1}, {6, 1} -> {5, 0, -1}, {6, 2} -> {6, 0, -1}
}], PlotTheme -> "Scientific"]应用 (2)
使用 ArrayPlot 将规则 30 可视化,并使用 RulePlot 绘制 CellularAutomaton 的规则:
ArrayPlot[CellularAutomaton[30, {{1}, 0}, 50], PlotTheme -> "Web"]RulePlot[CellularAutomaton[30], PlotTheme -> "Web"]用 RulePlot 来为 CellularAutomaton 的演化图加上图例:
RulePlot[CellularAutomaton[30], {{1}, 0}, 50, PlotLegends -> "Icon"]属性和关系 (2)
用 ArrayPlot 绘制细胞自动机的演进:
ArrayPlot[CellularAutomaton[90, {{1}, 0}, 50]]用 RulePlot 绘制演进图和规则图标:
RulePlot[CellularAutomaton[90], {{1}, 0}, 50, PlotLegends -> "Icon"]用 ArrayPlot 绘制图灵机的演进:
ArrayPlot[Last /@ TuringMachine[2506, {1, {{}, 0}}, 20]]用 RulePlot 绘制演进图和机器的读写头:
RulePlot[TuringMachine[2506], {1, {{}, 0}}, 20]文本
Wolfram Research (2016),RulePlot,Wolfram 语言函数,https://reference.wolfram.com/language/ref/RulePlot.html (更新于 2021 年).
CMS
Wolfram 语言. 2016. "RulePlot." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2021. https://reference.wolfram.com/language/ref/RulePlot.html.
APA
Wolfram 语言. (2016). RulePlot. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/RulePlot.html 年
BibTeX
@misc{reference.wolfram_2026_ruleplot, author="Wolfram Research", title="{RulePlot}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/RulePlot.html}", note=[Accessed: 06-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_ruleplot, organization={Wolfram Research}, title={RulePlot}, year={2021}, url={https://reference.wolfram.com/language/ref/RulePlot.html}, note=[Accessed: 06-July-2026]}