Draw graph wherein vertices are ArrayPlots

r := RandomReal[{0, 1}, {10, 10}]; 
Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \[UndirectedEdge] 1}, 
   VertexShape -> {1 -> ArrayPlot[r], 2 -> ArrayPlot[r],  3 -> ArrayPlot[r]}, 
   VertexSize -> Medium]

enter image description here


I think it is a bit closer than bill's answer

r = {{1, {0, 0, 1}}, {2, {0, 1, 0}}, {3, {1, 1, 0}}};

Graph[{1 -> 2, 2 -> 3, 3 -> 1}, 
  VertexShape -> (# -> ArrayPlot[{#2}, PlotRangePadding -> 0] & @@@ r),
    VertexSize -> {0.3, 0.1}]

enter image description here


I thought you may adopt this neat Demonstration by Stephen Wolfram. You can download the source code notebook right there where the link points, but the code is so small I gave it here too. Note the cool trick - when graph becomes too large, vertices become dots - may come handy.

Cellular Automaton State Transition Diagrams

enter image description here

Manipulate[
 If[icon, Labeled[#, 
     Grid[{Column[
          Map[ArrayPlot[{#}, Mesh -> True, Frame -> False, 
             ImageSize -> 8 Length[#]] &, #], Center, 
          Spacings -> .025] & /@ 
        Thread[{Tuples[{1, 0}, 3], List /@ IntegerDigits[rn, 2, 8]}]},
       Frame -> All, FrameStyle -> GrayLevel[1/GoldenRatio]]], #] &[
  GraphPlot[# -> CellularAutomaton[rn, #] & /@ Tuples[{1, 0}, w], 
   ImageSize -> {500, 375}, 
   VertexRenderingFunction -> (With[{p = {Darker[Blue, .7], 
          Point[#]}}, 
       If[! label, p, 
        If[w < 7, 
         Inset[ArrayPlot[{#2}, Mesh -> True, Frame -> False, 
           ImageSize -> 7 { Length[#2], 1}], #], 
         Tooltip[p, 
          Dynamic[ArrayPlot[{#2}, Mesh -> True, Frame -> False, 
            ImageSize -> 7 { Length[#2], 1}]]]]]] &), 
   DirectedEdges -> True]], {{rn, 110, "rule number"}, 0, 255, 1, 
  Appearance -> "Labeled"},
 {{w, 5, "width"}, 3, 12, 1, Appearance -> "Labeled"}, Delimiter,
 {{label, If[w < 7, True, False], "show states"}, {True, False}},
 {{icon, False, "show rule icon"}, {True, False}}, 
 AutorunSequencing -> {{1, 20}, {3, 5}}, SaveDefinitions -> True]