({{, (RefLink[RulePlot, paclet:ref/RulePlot])[sys] 
generates a plot representing the rule for the computational system sys.}, {, (RefLink[RulePlot, paclet:ref/RulePlot])[sys,init,t]
generates a plot of the evolution of the system sys from initial condition init for t steps.}, {, (RefLink[RulePlot, paclet:ref/RulePlot])[sys,evol]
generates a plot of the evolution evol assuming it is derived from a system of the form sys.}})

OpenersNotesSection(Spacer1)Details and Options

Possible computational systems sys include:

(RefLink[RulePlot, paclet:ref/RulePlot]) works with 1D and 2D systems.

Options include:

Possible appearance elements include:

Possible plot legend forms include:

In the form (RefLink[RulePlot, paclet:ref/RulePlot])[sys,evol], specific rules are typically ignored; only the implicit or explicit specification of number of colors, states, etc. is used.

OpenersPrimaryExamplesSection(Spacer1)Examples  (63)

OpenersExampleSection0(Spacer1)Basic Examples  (5)

Return the rule icon for elementary cellular automaton rule 30:

RulePlot[CellularAutomaton[30]]

Plot the evolution of a cellular automaton for 10 steps:

RulePlot[CellularAutomaton[30],{{1},0},10]

Include the rule icon:

RulePlot[CellularAutomaton[30],{{1},0},10,PlotLegends->"Icon"]

Plot the evolution of a Turing machine:

RulePlot[TuringMachine[{596440,2,3}],{1,{{},0}},20]

Return its rule icon:

RulePlot[TuringMachine[{596440,2,3}]]

Generate the evolution of a Turing machine:

evolution=TuringMachine[{596440,2,3},{1,{{},0}},5]

Use (RefLink[RulePlot, paclet:ref/RulePlot]) to display the history, using information on the rule to determine the form:

RulePlot[TuringMachine[{596440,2,3}],evolution]

Show the rule icon for a substitution system:

RulePlot[SubstitutionSystem[{1->{1,0},0->{0,1}}],Appearance->"Arrow"]

OpenersExampleSection1(Spacer1)Scope  (36)

OpenersExampleSubsection0(Spacer1)System Rules  (27)

OpenersExampleSubsubsection0(Spacer1)CellularAutomaton  (11)

Elementary cellular automaton rule 90:

RulePlot[CellularAutomaton[90]]

Cellular automaton with more than two colors:

RulePlot[CellularAutomaton[{679458,3}]]

Cellular automaton with range greater than 1:

RulePlot[CellularAutomaton[{1234,2,2}]]

Cellular automaton with fractional range:

RulePlot[CellularAutomaton[{9,2,3/2}]]

Totalistic 3-color cellular automaton:

RulePlot[CellularAutomaton[{1599,{3,1}}]]

Outer totalistic 3-color cellular automaton:

RulePlot[CellularAutomaton[{1000,{3,{3,1,3}}}]]

General two-dimensional cellular automaton:

RulePlot[CellularAutomaton[{23571113171923,2,{1,1}}]]

Totalistic two-dimensional 5-neighbor rule:

RulePlot[CellularAutomaton[{20,{2,{{0,1,0},{1,1,1},{0,1,0}}},{1,1}}]]

Totalistic two-dimensional 9-neighbor rule:

RulePlot[CellularAutomaton[{111,{2,{{1,1,1},{1,1,1},{1,1,1}}},{1,1}}]]

Outer totalistic two-dimensional rule:

RulePlot[CellularAutomaton[{222,{2,{{2,2,2},{2,1,2},{2,2,2}}},{1,1}}]]

Rules specified using associations:

RulePlot[CellularAutomaton[<|"RuleNumber"->30|>]]

RulePlot[CellularAutomaton[<|"TotalisticCode"->14,"Dimension"->2|>]]

RulePlot[CellularAutomaton[<|"OuterTotalisticCode"->110,"Dimension"->2,"Neighborhood"->5|>]]

OpenersExampleSubsubsection1(Spacer1)TuringMachine  (4)

Turing machine rule 2506:

RulePlot[TuringMachine[2506]]

Turing machine with more than two states:

RulePlot[TuringMachine[{600720,3}]]

Turing machine with more than two colors:

RulePlot[TuringMachine[{596440,2,3}]]

Turing machines specified by rules:

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}}]]

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"]

OpenersExampleSubsubsection2(Spacer1)SubstitutionSystem  (8)

String substitution system for two characters:

RulePlot[SubstitutionSystem[{"a"->"ba","b"->"aa"}]]

String substitution system for more than two characters:

RulePlot[SubstitutionSystem[{"a"->"ba","b"->"da","c"->"ca","d"->"bc"}]]

String substitution system for length-2 strings:

RulePlot[SubstitutionSystem[{"aa"->"bc","ab"->"aa","ba"->"ab","cb"->"ac","cc"->"ba"}]]

String substitution system for strings of different lengths:

RulePlot[SubstitutionSystem[{"aa"->"ba","ab"->"c","bac"->"aba","bba"->"b","c"->"bc"}]]

List substitution system for two integer values:

RulePlot[SubstitutionSystem[{0->{0,1},1->{0,0}}]]

List substitution system for more than two integer values:

RulePlot[SubstitutionSystem[{0->{0,1},1->{2,3},2->{1,2},3->{2,0}}]]

List substitution system with lists of different lengths:

RulePlot[SubstitutionSystem[{0->{0,1,3},1->{2,3},2->{1},3->{2,0}}]]

Two-dimensional substitution systems:

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}}}]]

OpenersExampleSubsubsection3(Spacer1)BooleanFunction  (4)

Boolean function in two variables:

RulePlot[BooleanFunction[8,2]]

Boolean function in more than two variables:

RulePlot[BooleanFunction[251084,5]]

Boolean function based on a vector of truth values:

RulePlot[BooleanFunction[{True,True,True,False,False,False,False,False}]]

Boolean function based on a table of truth rules:

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
}]]

OpenersExampleSubsection1(Spacer1)System Evolution  (9)

OpenersExampleSubsubsection4(Spacer1)CellularAutomaton  (5)

Evolution of rule 30 for 10 steps:

RulePlot[CellularAutomaton[30],{0,0,1,1,1,0,0},10]

Evolution for 50 steps from a single 1 on a background of 0s:

RulePlot[CellularAutomaton[30],{{1},0},50]

Evolution of a 3-color cellular automaton:

RulePlot[CellularAutomaton[{679458,3}],{{1},0},120]

Evolution from a single 1 on a background of repeated 0110 blocks:

RulePlot[CellularAutomaton[{679458,3}],{{1},{0,1,1,0}},120]

Evolution of a 3-color totalistic code:

RulePlot[CellularAutomaton[{2049,{3,1}}],{{1},0},100]

Evolution of a 3-color outer totalistic code:

RulePlot[CellularAutomaton[{50010,{3,{3,1,3}}}],{{1},0},100]

Evolution of rules specified by associations:

RulePlot[CellularAutomaton[<|"RuleNumber"->23898,"Range"->3/2|>],{{1},0},80]

RulePlot[CellularAutomaton[<|"TotalisticCode"->1599,"Colors"->3|>],{{1},0},200]

OpenersExampleSubsubsection5(Spacer1)TuringMachine  (4)

Evolution of a 2-state, 2-color Turing machine, starting with a tape of four 0s:

RulePlot[TuringMachine[2506],{1,{0,0,0,0}},20]

Evolution starting with an infinite tape of 0s:

RulePlot[TuringMachine[2506],{1,{{},0}},20]

Evolution of a 3-state, 2-color Turing machine:

RulePlot[TuringMachine[{956440,3}],{1,{{},0}},20]

Evolution starting with a tape of 1 on a background of 0s:

RulePlot[TuringMachine[{956440,3}],{1,{{1},0}},20]

Evolution of a 2-state, 3-color Turing machine:

RulePlot[TuringMachine[{596440,2,3}],{1,{{},0}},20]

Evolution with the head initially in state 2:

RulePlot[TuringMachine[{596440,2,3}],{2,{{},0}},20]

Evolution of a Turing machine specified by rules, starting from a background of repeated 021 blocks:

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]

OpenersExampleSection2(Spacer1)Options  (18)

OpenersExampleSubsection2(Spacer1)Appearance  (4)

Use hexagons:

RulePlot[CellularAutomaton[{9,2,1/2}],Appearance->"Hexagons"]

Use bricks:

RulePlot[CellularAutomaton[{9,2,1/2}],Appearance->"Bricks"]

Sometimes you can get a simplified result that shows cells whose value does not matter:

RulePlot[CellularAutomaton[30],Appearance->"Simplified"]

Shorten the display of the rule set:

RulePlot[CellularAutomaton[{31469,5}],Appearance->"Short"]

OpenersExampleSubsection3(Spacer1)ColorRules  (1)

Specify color rules for explicit values or patterns:

RulePlot[CellularAutomaton[{1234,3}],ColorRules->{0->White,1->Red,_->Purple}]

OpenersExampleSubsection4(Spacer1)Frame  (1)

Do not use a frame:

RulePlot[CellularAutomaton[30],Frame->False]

OpenersExampleSubsection5(Spacer1)FrameStyle  (2)

Make the frame blue:

RulePlot[CellularAutomaton[30],FrameStyle->Blue]

Give a composite directive for the frame:

RulePlot[CellularAutomaton[30],FrameStyle->Directive[Orange,Dashed]]

OpenersExampleSubsection6(Spacer1)Mesh  (1)

By default, a mesh is drawn around individual cells:

RulePlot[CellularAutomaton[30],PlotTheme->"Web"]

Do not use a mesh:

RulePlot[CellularAutomaton[30],Mesh->False,PlotTheme->"Web"]

OpenersExampleSubsection7(Spacer1)MeshStyle  (2)

Make the mesh blue:

RulePlot[CellularAutomaton[30],MeshStyle->Blue]

Give a composite directive for the mesh:

RulePlot[CellularAutomaton[30],MeshStyle->Directive[Orange,Thick]]

OpenersExampleSubsection8(Spacer1)PlotLegends  (3)

Give a plot legend describing the rule in text:

RulePlot[CellularAutomaton[30],PlotLegends->"Text"]

Give a plot legend describing the rule as an icon:

RulePlot[CellularAutomaton[30],{{1},0},20,PlotLegends->"Icon"]

Give an arbitrary plot legend:

RulePlot[CellularAutomaton[30],{{1},0},100,PlotLegends->Placed[Text["complex behavior"],Below]]

OpenersExampleSubsection9(Spacer1)PlotMarkers  (2)

Make the marker of a Turing machine gray:

RulePlot[TuringMachine[{596440,2,3}],{1,{{},0}},20,PlotMarkers->Gray]

Draw the outline of the default markers:

RulePlot[TuringMachine[{596440,2,3}],{1,{{},0}},20,PlotMarkers->Directive[EdgeForm[{Black,AbsoluteThickness[1]}],
FaceForm[]]]

OpenersExampleSubsection10(Spacer1)PlotTheme  (1)

Use the web plot theme:

RulePlot[CellularAutomaton[30],PlotTheme->"Web"]

Use this theme without a mesh:

RulePlot[CellularAutomaton[30],PlotTheme->"Web",Mesh->False]

OpenersExampleSubsection11(Spacer1)Spacings  (1)

Change the spacing inside the frame:

RulePlot[CellularAutomaton[30],Spacings->1]

Change the spacing on each side of the icon:

RulePlot[CellularAutomaton[30],Spacings->{{1,2},{3,4}}]

OpenersExampleSection3(Spacer1)Applications  (2)

ArrayPlot[CellularAutomaton[30,{{1},0},50],PlotTheme->"Web"]

RulePlot[CellularAutomaton[30],PlotTheme->"Web"]

Use (RefLink[RulePlot, paclet:ref/RulePlot]) to legend the evolution of a (RefLink[CellularAutomaton, paclet:ref/CellularAutomaton]):

RulePlot[CellularAutomaton[30],{{1},0},50,PlotLegends->"Icon"]

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

Plot the evolution of a cellular automaton with (RefLink[ArrayPlot, paclet:ref/ArrayPlot]):

ArrayPlot[CellularAutomaton[90,{{1},0},50]]

Use (RefLink[RulePlot, paclet:ref/RulePlot]) to plot the evolution and the rule icon:

RulePlot[CellularAutomaton[90],{{1},0},50,PlotLegends->"Icon"]

Plot the evolution of a Turing machine with (RefLink[ArrayPlot, paclet:ref/ArrayPlot]):

ArrayPlot[Last/@TuringMachine[2506,{1,{{},0}},20]]

Use (RefLink[RulePlot, paclet:ref/RulePlot]) to plot the evolution and the head of the machine:

RulePlot[TuringMachine[2506],{1,{{},0}},20]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ArrayPlot, paclet:ref/ArrayPlot])  ▪  (RefLink[CellularAutomaton, paclet:ref/CellularAutomaton])  ▪  (RefLink[TuringMachine, paclet:ref/TuringMachine])  ▪  (RefLink[SubstitutionSystem, paclet:ref/SubstitutionSystem])  ▪  (RefLink[BooleanFunction, paclet:ref/BooleanFunction])  ▪  (RefLink[BooleanTable, paclet:ref/BooleanTable])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Boolean Computation, paclet:guide/BooleanComputation])}, {▪(RefLinkPlain[Computational Systems, paclet:guide/ComputationalSystemsAndDiscovery])}, {▪(RefLinkPlain[Iterated Maps & Fractals, paclet:guide/IteratedMapsAndFractals])}, {▪(RefLinkPlain[Discrete Mathematics, paclet:guide/DiscreteMathematics])}})}})