0
|
3709 Views
|
|
0 Total Likes
View groups...
Share

# Specific style for a graphic

Posted 9 years ago
 I have the following code. Bk = {{{0, 0}, {62, 61}, 1}, {{0, 0}, {60, 50}, 2}, {{0, 50}, {60, 100}, 2}, {{60, 50}, {120, 100}, 2}}; rec = {}; graficar[bk_List] := Module[{placas, lamina, medidas, dibujo,i}, placas = Max[bk[[;; , 3]]]; For[i = 1, i <= placas, i++, lamina = Most[#] & /@ Cases[bk, {{_, _}, {_, _}, i}]; dibujo = Graphics[ Prepend[Apply[Rectangle, lamina, 1], {Red, Rectangle[{0, 0}, {120, 100}]}], PlotLabel -> "Lámina número " <> ToString[i]]; AppendTo[rec, dibujo] ] ] graficar[Bk]  and rec request I get the following graph . and I want something like: Any Help is welcome,thanks in advance.
 With a slight modification it comes out  In[121]:= Clear[Bk] Bk = {{{0, 0}, {62, 61}, 1}, {{0, 0}, {60, 50}, 2}, {{0, 50}, {60, 100}, 2}, {{60, 50}, {120, 100}, 2}}; Clear[graficar] graficar[bk_List] := Module[{placas = Max[bk[[;; , 3]]], lamina, medidas, dibujo, i, rec = {}}, For[i = 1, i <= placas, i++, lamina = Most[#] & /@ Cases[bk, {{_, _}, {_, _}, i}]; dibujo = Graphics[Prepend[{EdgeForm[{Blue, Thick, Dashed}], Green, Rectangle @@@ lamina}, {Red, Rectangle[{0, 0}, {120, 100}]}], PlotLabel -> "Lámina número " <> ToString[i] ]; AppendTo[rec, dibujo] ]; rec ] as