GraphicsGrid (Corrected Posting)
- To: mathgroup at smc.vnet.net
- Subject: [mg82388] GraphicsGrid (Corrected Posting)
- From: Bruce Colletti <vze269bv at verizon.net>
- Date: Fri, 19 Oct 2007 04:56:03 -0400 (EDT)
(My original posting omitted the "convert" function, and so the complete code is reposted here. Jean-Marc, thank you for catching the oversight.) Re 6.0.1 under WinXP. In the skeletal code below (actual code follows thereafter), the two GraphicsGrid commands produce the desired output. However, the second command also produces the error messages shown. Why do these messages appear? Thanks. Bruce X = an integer matrix; g = GraphPlot[ ...]; GraphicsGrid[{{X, X, X}, g}] T = X; T[[1, 2]] = Item[T[[1, 2]], Background -> Red]; GraphicsGrid[{{T, T, T}, g}] Thread::tdlen: Objects of unequal length in \ {{1,1,1,2},{1,2,1,2},{1,3,1,2}}->{} cannot be combined. >> Part::partw: Part 2 of Graphics`GraphicsGridDump`CleanseRule[<<1>>] \ does not exist. >> Set::pspec: Part specification {{1,1,1,2},{1,2,1,2},{1,3,1,2}} is \ neither an integer nor a list of integers. >> ***** ACTUAL CODE ***** convert[p_, n_] := Join[Flatten[MapThread[#1 -> #2 &, {#, RotateLeft@#}] & /@ p], # -> # & /@ Complement[Range@n, Flatten@p]]; n = 7; X = RandomInteger[{1, 9}, {n, n}]; perms = {{{1, 2, 3}, {5, 6}}, {{2, 5, 1, 4, 3, 7, 6}}, {Range@4, Range[5, n]}}; g = GraphPlot[convert[#, n], ImageSize -> 100, DirectedEdges -> True, VertexLabeling -> True] & /@ perms; GraphicsGrid[{{X, X, X}, g}] T = X; T[[1, 2]] = Item[T[[1, 2]], Background -> Red]; GraphicsGrid[{{T, T, T}, g}]