Tikzpicture: How to color separate fields at the arrays and use resizebox?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I want to color only separated nodes? How could I do this? I want also resize the tikzfigure, but I got the error message Undefined control sequence. }



 documentclass[12pt]article
usepackageamsmath
usepackageamsfonts

usepackagetikz
usetikzlibraryintersections,matrix

begindocument
beginfigure
resizebox textwidth !
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

border/.style=draw

matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,10) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture

endfigure
enddocument


Output










share|improve this question























  • Your editid code doesn't compile for some reason... Please fix your preamble.
    – koleygr
    Sep 16 at 14:01






  • 1




    I made it work and your problem was explained in this answer: tex.stackexchange.com/a/15096/120578. But if you use the way of my edited answer about the specific problem and the solution on the original question of @Zarco your result will be better. His answer deserves to be the accepted if you return to the original problem that I suggest you have to do. So, do it (return to the original different and more usefull for the forum question) and accept his answer. The new question is just a dupplicate of the link
    – koleygr
    Sep 16 at 14:16











  • one problem per question, please!
    – Zarko
    Sep 16 at 15:06










  • @koleygr Thank you.
    – ikreb
    Sep 16 at 15:22














up vote
2
down vote

favorite












I want to color only separated nodes? How could I do this? I want also resize the tikzfigure, but I got the error message Undefined control sequence. }



 documentclass[12pt]article
usepackageamsmath
usepackageamsfonts

usepackagetikz
usetikzlibraryintersections,matrix

begindocument
beginfigure
resizebox textwidth !
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

border/.style=draw

matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,10) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture

endfigure
enddocument


Output










share|improve this question























  • Your editid code doesn't compile for some reason... Please fix your preamble.
    – koleygr
    Sep 16 at 14:01






  • 1




    I made it work and your problem was explained in this answer: tex.stackexchange.com/a/15096/120578. But if you use the way of my edited answer about the specific problem and the solution on the original question of @Zarco your result will be better. His answer deserves to be the accepted if you return to the original problem that I suggest you have to do. So, do it (return to the original different and more usefull for the forum question) and accept his answer. The new question is just a dupplicate of the link
    – koleygr
    Sep 16 at 14:16











  • one problem per question, please!
    – Zarko
    Sep 16 at 15:06










  • @koleygr Thank you.
    – ikreb
    Sep 16 at 15:22












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I want to color only separated nodes? How could I do this? I want also resize the tikzfigure, but I got the error message Undefined control sequence. }



 documentclass[12pt]article
usepackageamsmath
usepackageamsfonts

usepackagetikz
usetikzlibraryintersections,matrix

begindocument
beginfigure
resizebox textwidth !
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

border/.style=draw

matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,10) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture

endfigure
enddocument


Output










share|improve this question















I want to color only separated nodes? How could I do this? I want also resize the tikzfigure, but I got the error message Undefined control sequence. }



 documentclass[12pt]article
usepackageamsmath
usepackageamsfonts

usepackagetikz
usetikzlibraryintersections,matrix

begindocument
beginfigure
resizebox textwidth !
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

border/.style=draw

matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,10) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture

endfigure
enddocument


Output







tikz-pgf color vector






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 16 at 13:49

























asked Sep 16 at 12:45









ikreb

1927




1927











  • Your editid code doesn't compile for some reason... Please fix your preamble.
    – koleygr
    Sep 16 at 14:01






  • 1




    I made it work and your problem was explained in this answer: tex.stackexchange.com/a/15096/120578. But if you use the way of my edited answer about the specific problem and the solution on the original question of @Zarco your result will be better. His answer deserves to be the accepted if you return to the original problem that I suggest you have to do. So, do it (return to the original different and more usefull for the forum question) and accept his answer. The new question is just a dupplicate of the link
    – koleygr
    Sep 16 at 14:16











  • one problem per question, please!
    – Zarko
    Sep 16 at 15:06










  • @koleygr Thank you.
    – ikreb
    Sep 16 at 15:22
















  • Your editid code doesn't compile for some reason... Please fix your preamble.
    – koleygr
    Sep 16 at 14:01






  • 1




    I made it work and your problem was explained in this answer: tex.stackexchange.com/a/15096/120578. But if you use the way of my edited answer about the specific problem and the solution on the original question of @Zarco your result will be better. His answer deserves to be the accepted if you return to the original problem that I suggest you have to do. So, do it (return to the original different and more usefull for the forum question) and accept his answer. The new question is just a dupplicate of the link
    – koleygr
    Sep 16 at 14:16











  • one problem per question, please!
    – Zarko
    Sep 16 at 15:06










  • @koleygr Thank you.
    – ikreb
    Sep 16 at 15:22















Your editid code doesn't compile for some reason... Please fix your preamble.
– koleygr
Sep 16 at 14:01




Your editid code doesn't compile for some reason... Please fix your preamble.
– koleygr
Sep 16 at 14:01




1




1




I made it work and your problem was explained in this answer: tex.stackexchange.com/a/15096/120578. But if you use the way of my edited answer about the specific problem and the solution on the original question of @Zarco your result will be better. His answer deserves to be the accepted if you return to the original problem that I suggest you have to do. So, do it (return to the original different and more usefull for the forum question) and accept his answer. The new question is just a dupplicate of the link
– koleygr
Sep 16 at 14:16





I made it work and your problem was explained in this answer: tex.stackexchange.com/a/15096/120578. But if you use the way of my edited answer about the specific problem and the solution on the original question of @Zarco your result will be better. His answer deserves to be the accepted if you return to the original problem that I suggest you have to do. So, do it (return to the original different and more usefull for the forum question) and accept his answer. The new question is just a dupplicate of the link
– koleygr
Sep 16 at 14:16













one problem per question, please!
– Zarko
Sep 16 at 15:06




one problem per question, please!
– Zarko
Sep 16 at 15:06












@koleygr Thank you.
– ikreb
Sep 16 at 15:22




@koleygr Thank you.
– ikreb
Sep 16 at 15:22










3 Answers
3






active

oldest

votes

















up vote
4
down vote



accepted










your question is not very clear to me, so i suspect, that you looking for something as you can see in the first two rows of your image:



enter image description here



tel me, if i'm wrong.



edit:



well, apparently i was misunderstood the question. coloring just one cell is simple. using the most of code from my previous answer (which is quite more concise and shorter from yours), you can rewrote your picture code as follows:



documentclass[tikz, margin=3mm]standalone
usetikzlibrarymatrix

begindocument
begintikzpicture
tikzset
mtrx/.style=
matrix of nodes,
nodes in empty cells,
nodes=draw, minimum size=2mm,
row sep=-pgflinewidth,
column sep=-pgflinewidth,

matrix (vector) [mtrx=red] at (3,10) & & & & & & & \
;
matrix (vector) [mtrx=blue!30] at (10,10) & ;
matrix(vector)[mtrx=green] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[mtrx] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[mtrx] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[mtrx] at (3,4) & & & & & & & \
;
matrix(vector)[mtrx] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[mtrx] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[mtrx] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[mtrx] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[mtrx] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture
enddocument


enter image description here






share|improve this answer






















  • I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
    – koleygr
    Sep 16 at 13:25











  • Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
    – ikreb
    Sep 16 at 13:26










  • @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    Sep 16 at 13:52










  • @ikreb, see edited answer!
    – Zarko
    Sep 16 at 13:53










  • @Zarko.. You win (+1 enough time before).
    – koleygr
    Sep 16 at 14:21

















up vote
3
down vote













The only easy solution that I found is to use nested tikzpictures... But it is really simple. Also used svgnames for more colors:



Code:



 documentclass[tikz,svgnames]standalone
usetikzlibrarymatrix
usepackagepgf

newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
begintikzpicture[overlay, remember picture]
draw[draw=none,fill=#1,shift=(-0.11,-0.115)](0,0)rectangle(0.22,0.225);
endtikzpicture

begindocument
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

border/.style=draw

matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,10) myfillRed & & &myfillGreen &myfillBrown & & & myfillBlue!30!Yellow& & & & & & & & & & & & & & & & & & & & & myfillBlue\
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,7) &myfillGreen & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture
enddocument


Output:



enter image description here



Edit: After OPS Edit:



documentclass[12pt]article
usepackageamsmath
usepackageamsfonts

usepackagetikz
usetikzlibraryintersections,matrix

newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
begintikzpicture[overlay, remember picture]
draw[draw=none,fill=#1,shift=(-0.13,-0.13)](0,0)rectangle(0.255,0.26);
endtikzpicture

begindocument
beginfigure
resizebox textwidth !
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

border/.style=draw

matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,10) myfillgreen& myfillred& & & & & & myfillbrown\
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,10) & & myfillyellow& & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,4) &myfillgreen & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

draw [thick,->] (10.3,9.8) -- (10.3,9.2);
node at(10.7,9.5) $oplus$;
draw [thick,->] (10.3,8.8) -- (10.3,8.2);
node at(10.7,8.5) $oplus$;
draw [thick,->] (10.3,7.8) -- (10.3,7.2);
node at(10.7,7.5) $T$;

draw [thick,->] (10.3,3.8) -- (10.3,3.2);
node at(10.7,3.5) $oplus$;
draw [thick,->] (10.3,2.8) -- (10.3,2.2);
node at(10.7,2.5) $oplus$;
draw [thick,->] (10.3,1.8) -- (10.3,1.2);
node at(10.7,1.5) $oplus$;
draw [thick,->] (10.3,0.8) -- (10.3,0.2);
node at(10.7,0.5) $T$;

node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,7) $S'_127$:;

node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

node at (5.3,3) $S'_127$:;
node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node at (5.3,0) $S'_126$:;

endtikzpicture

endfigure
enddocument





share|improve this answer






















  • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    Sep 16 at 13:22










  • Updated answer colors with more accuracy.
    – koleygr
    Sep 16 at 13:30










  • Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
    – ikreb
    Sep 16 at 13:33










  • Thanks for your soultion!
    – ikreb
    Sep 16 at 13:33










  • @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
    – koleygr
    Sep 16 at 13:39

















up vote
2
down vote













Here is an answer that makes use of resizebox. All you need to do is to put the tikzpicture in a lrbox. As for your real question, you only need to put |[fill=red]| in a given cell to fill the cell. I add some examples to the code.



documentclass[12pt]article
usepackageamsmath
usepackageamsfonts

usepackagetikz
usetikzlibraryintersections,matrix,positioning
newsaveboxpicbox
begindocument
beginfigure
beginlrboxpicbox
begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]
border/.style=draw
matrix(vector-1)[matrix of nodes, nodes=draw] [fill=red];
matrix(vector-2)[right=2cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector-3)[below=1cm of vector-2,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector-4)[below=1cm of vector-3,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector-5)[below=1cm of vector-4,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & \
;

matrix(vector-6)[below=6.5cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & \
;
matrix(vector-7)[right=2cm of vector-6,matrix of nodes, nodes=draw] [fill=yellow];
matrix(vector-8)[below=1cm of vector-7,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector-9)[below=1cm of vector-8,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector-10)[below=1cm of vector-9,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
matrix(vector-11)[below=1cm of vector-10,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
;
%
foreach X [evaluate=X as Y using int(X-1)] in 3,4,8,9,10
draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$oplus$;
%
foreach X [evaluate=X as Y using int(X-1)] in 5,11
draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$T$;
%
draw[thick,-latex] (vector-1) -- (vector-2) node[midway,above]$R_0$;
draw[thick,-latex] (vector-6) -- (vector-7) node[midway,above]$R_7$;
%
node[left=2mm of vector-1,anchor=east] $B_4^0leftarrowmathcalB_7,$$:;
%
node[left=2mm of vector-3,anchor=east] $S_127,S_0,S_24,S_50,S_75,S_102$:;
node[left=2mm of vector-4,anchor=east] $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node[left=2mm of vector-5,anchor=east] $S'_127$:;
%
node[left=2mm of vector-6,anchor=east]$B_5^0leftarrowmathcalB_3,b$:;
%
node[left=2mm of vector-8,anchor=east] $S'_127$:;
node[left=2mm of vector-9,anchor=east] $S_0,S_24,S_50,S_75,S_102$:;
node[left=2mm of vector-10,anchor=east] $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
node[left=2mm of vector-11,anchor=east] $S'_126$:;
%
endtikzpicture
endlrbox
resizeboxtextwidth!useboxpicbox
endfigure
enddocument


enter image description here



A word of caution: it is quite possible that someone may copy my code, add some feature like chains, and claim that this code then becomes much more "concise". I'd kindly ask you to check if this really the case. Your code is already very well structured and thus easy to understand and adjustable. I used used positioning because I think it is advantageous here, and also use foreach loops to repeat things. Personally I would refrain from using chains here for several reasons, one of them being that you lose some flexibility of adjusting positions. Likewise, you could define styles for repeating things, but your code is so well structured that I don't think that makes a big difference. So this is just to say that if someone claims to be more "concise" you should critically ask yourself if that's really true.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451104%2ftikzpicture-how-to-color-separate-fields-at-the-arrays-and-use-resizebox%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote



    accepted










    your question is not very clear to me, so i suspect, that you looking for something as you can see in the first two rows of your image:



    enter image description here



    tel me, if i'm wrong.



    edit:



    well, apparently i was misunderstood the question. coloring just one cell is simple. using the most of code from my previous answer (which is quite more concise and shorter from yours), you can rewrote your picture code as follows:



    documentclass[tikz, margin=3mm]standalone
    usetikzlibrarymatrix

    begindocument
    begintikzpicture
    tikzset
    mtrx/.style=
    matrix of nodes,
    nodes in empty cells,
    nodes=draw, minimum size=2mm,
    row sep=-pgflinewidth,
    column sep=-pgflinewidth,

    matrix (vector) [mtrx=red] at (3,10) & & & & & & & \
    ;
    matrix (vector) [mtrx=blue!30] at (10,10) & ;
    matrix(vector)[mtrx=green] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[mtrx] at (3,4) & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    enter image description here






    share|improve this answer






















    • I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
      – koleygr
      Sep 16 at 13:25











    • Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
      – ikreb
      Sep 16 at 13:26










    • @koleygr, permanently you win in guessing! congratulation and +1!
      – Zarko
      Sep 16 at 13:52










    • @ikreb, see edited answer!
      – Zarko
      Sep 16 at 13:53










    • @Zarko.. You win (+1 enough time before).
      – koleygr
      Sep 16 at 14:21














    up vote
    4
    down vote



    accepted










    your question is not very clear to me, so i suspect, that you looking for something as you can see in the first two rows of your image:



    enter image description here



    tel me, if i'm wrong.



    edit:



    well, apparently i was misunderstood the question. coloring just one cell is simple. using the most of code from my previous answer (which is quite more concise and shorter from yours), you can rewrote your picture code as follows:



    documentclass[tikz, margin=3mm]standalone
    usetikzlibrarymatrix

    begindocument
    begintikzpicture
    tikzset
    mtrx/.style=
    matrix of nodes,
    nodes in empty cells,
    nodes=draw, minimum size=2mm,
    row sep=-pgflinewidth,
    column sep=-pgflinewidth,

    matrix (vector) [mtrx=red] at (3,10) & & & & & & & \
    ;
    matrix (vector) [mtrx=blue!30] at (10,10) & ;
    matrix(vector)[mtrx=green] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[mtrx] at (3,4) & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    enter image description here






    share|improve this answer






















    • I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
      – koleygr
      Sep 16 at 13:25











    • Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
      – ikreb
      Sep 16 at 13:26










    • @koleygr, permanently you win in guessing! congratulation and +1!
      – Zarko
      Sep 16 at 13:52










    • @ikreb, see edited answer!
      – Zarko
      Sep 16 at 13:53










    • @Zarko.. You win (+1 enough time before).
      – koleygr
      Sep 16 at 14:21












    up vote
    4
    down vote



    accepted







    up vote
    4
    down vote



    accepted






    your question is not very clear to me, so i suspect, that you looking for something as you can see in the first two rows of your image:



    enter image description here



    tel me, if i'm wrong.



    edit:



    well, apparently i was misunderstood the question. coloring just one cell is simple. using the most of code from my previous answer (which is quite more concise and shorter from yours), you can rewrote your picture code as follows:



    documentclass[tikz, margin=3mm]standalone
    usetikzlibrarymatrix

    begindocument
    begintikzpicture
    tikzset
    mtrx/.style=
    matrix of nodes,
    nodes in empty cells,
    nodes=draw, minimum size=2mm,
    row sep=-pgflinewidth,
    column sep=-pgflinewidth,

    matrix (vector) [mtrx=red] at (3,10) & & & & & & & \
    ;
    matrix (vector) [mtrx=blue!30] at (10,10) & ;
    matrix(vector)[mtrx=green] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[mtrx] at (3,4) & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    enter image description here






    share|improve this answer














    your question is not very clear to me, so i suspect, that you looking for something as you can see in the first two rows of your image:



    enter image description here



    tel me, if i'm wrong.



    edit:



    well, apparently i was misunderstood the question. coloring just one cell is simple. using the most of code from my previous answer (which is quite more concise and shorter from yours), you can rewrote your picture code as follows:



    documentclass[tikz, margin=3mm]standalone
    usetikzlibrarymatrix

    begindocument
    begintikzpicture
    tikzset
    mtrx/.style=
    matrix of nodes,
    nodes in empty cells,
    nodes=draw, minimum size=2mm,
    row sep=-pgflinewidth,
    column sep=-pgflinewidth,

    matrix (vector) [mtrx=red] at (3,10) & & & & & & & \
    ;
    matrix (vector) [mtrx=blue!30] at (10,10) & ;
    matrix(vector)[mtrx=green] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[mtrx] at (3,4) & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[mtrx] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    enter image description here







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Sep 16 at 13:50

























    answered Sep 16 at 13:23









    Zarko

    114k863152




    114k863152











    • I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
      – koleygr
      Sep 16 at 13:25











    • Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
      – ikreb
      Sep 16 at 13:26










    • @koleygr, permanently you win in guessing! congratulation and +1!
      – Zarko
      Sep 16 at 13:52










    • @ikreb, see edited answer!
      – Zarko
      Sep 16 at 13:53










    • @Zarko.. You win (+1 enough time before).
      – koleygr
      Sep 16 at 14:21
















    • I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
      – koleygr
      Sep 16 at 13:25











    • Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
      – ikreb
      Sep 16 at 13:26










    • @koleygr, permanently you win in guessing! congratulation and +1!
      – Zarko
      Sep 16 at 13:52










    • @ikreb, see edited answer!
      – Zarko
      Sep 16 at 13:53










    • @Zarko.. You win (+1 enough time before).
      – koleygr
      Sep 16 at 14:21















    I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
    – koleygr
    Sep 16 at 13:25





    I think the question is not really clear too... But with "separate nodes" the OP possibly means what is in my answer's photo. May be it's my mistake... but let's wait for his reaction.
    – koleygr
    Sep 16 at 13:25













    Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
    – ikreb
    Sep 16 at 13:26




    Thanks for your answer. I want to color only one field and not the entire array. I will update my question. Sorry if the description was to bad.
    – ikreb
    Sep 16 at 13:26












    @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    Sep 16 at 13:52




    @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    Sep 16 at 13:52












    @ikreb, see edited answer!
    – Zarko
    Sep 16 at 13:53




    @ikreb, see edited answer!
    – Zarko
    Sep 16 at 13:53












    @Zarko.. You win (+1 enough time before).
    – koleygr
    Sep 16 at 14:21




    @Zarko.. You win (+1 enough time before).
    – koleygr
    Sep 16 at 14:21










    up vote
    3
    down vote













    The only easy solution that I found is to use nested tikzpictures... But it is really simple. Also used svgnames for more colors:



    Code:



     documentclass[tikz,svgnames]standalone
    usetikzlibrarymatrix
    usepackagepgf

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.11,-0.115)](0,0)rectangle(0.22,0.225);
    endtikzpicture

    begindocument
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,10) myfillRed & & &myfillGreen &myfillBrown & & & myfillBlue!30!Yellow& & & & & & & & & & & & & & & & & & & & & myfillBlue\
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,7) &myfillGreen & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    Output:



    enter image description here



    Edit: After OPS Edit:



    documentclass[12pt]article
    usepackageamsmath
    usepackageamsfonts

    usepackagetikz
    usetikzlibraryintersections,matrix

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.13,-0.13)](0,0)rectangle(0.255,0.26);
    endtikzpicture

    begindocument
    beginfigure
    resizebox textwidth !
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,10) myfillgreen& myfillred& & & & & & myfillbrown\
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,10) & & myfillyellow& & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,4) &myfillgreen & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture

    endfigure
    enddocument





    share|improve this answer






















    • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
      – koleygr
      Sep 16 at 13:22










    • Updated answer colors with more accuracy.
      – koleygr
      Sep 16 at 13:30










    • Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
      – ikreb
      Sep 16 at 13:33










    • Thanks for your soultion!
      – ikreb
      Sep 16 at 13:33










    • @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
      – koleygr
      Sep 16 at 13:39














    up vote
    3
    down vote













    The only easy solution that I found is to use nested tikzpictures... But it is really simple. Also used svgnames for more colors:



    Code:



     documentclass[tikz,svgnames]standalone
    usetikzlibrarymatrix
    usepackagepgf

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.11,-0.115)](0,0)rectangle(0.22,0.225);
    endtikzpicture

    begindocument
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,10) myfillRed & & &myfillGreen &myfillBrown & & & myfillBlue!30!Yellow& & & & & & & & & & & & & & & & & & & & & myfillBlue\
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,7) &myfillGreen & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    Output:



    enter image description here



    Edit: After OPS Edit:



    documentclass[12pt]article
    usepackageamsmath
    usepackageamsfonts

    usepackagetikz
    usetikzlibraryintersections,matrix

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.13,-0.13)](0,0)rectangle(0.255,0.26);
    endtikzpicture

    begindocument
    beginfigure
    resizebox textwidth !
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,10) myfillgreen& myfillred& & & & & & myfillbrown\
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,10) & & myfillyellow& & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,4) &myfillgreen & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture

    endfigure
    enddocument





    share|improve this answer






















    • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
      – koleygr
      Sep 16 at 13:22










    • Updated answer colors with more accuracy.
      – koleygr
      Sep 16 at 13:30










    • Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
      – ikreb
      Sep 16 at 13:33










    • Thanks for your soultion!
      – ikreb
      Sep 16 at 13:33










    • @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
      – koleygr
      Sep 16 at 13:39












    up vote
    3
    down vote










    up vote
    3
    down vote









    The only easy solution that I found is to use nested tikzpictures... But it is really simple. Also used svgnames for more colors:



    Code:



     documentclass[tikz,svgnames]standalone
    usetikzlibrarymatrix
    usepackagepgf

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.11,-0.115)](0,0)rectangle(0.22,0.225);
    endtikzpicture

    begindocument
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,10) myfillRed & & &myfillGreen &myfillBrown & & & myfillBlue!30!Yellow& & & & & & & & & & & & & & & & & & & & & myfillBlue\
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,7) &myfillGreen & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    Output:



    enter image description here



    Edit: After OPS Edit:



    documentclass[12pt]article
    usepackageamsmath
    usepackageamsfonts

    usepackagetikz
    usetikzlibraryintersections,matrix

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.13,-0.13)](0,0)rectangle(0.255,0.26);
    endtikzpicture

    begindocument
    beginfigure
    resizebox textwidth !
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,10) myfillgreen& myfillred& & & & & & myfillbrown\
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,10) & & myfillyellow& & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,4) &myfillgreen & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture

    endfigure
    enddocument





    share|improve this answer














    The only easy solution that I found is to use nested tikzpictures... But it is really simple. Also used svgnames for more colors:



    Code:



     documentclass[tikz,svgnames]standalone
    usetikzlibrarymatrix
    usepackagepgf

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.11,-0.115)](0,0)rectangle(0.22,0.225);
    endtikzpicture

    begindocument
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw] at (3,10) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,10) myfillRed & & &myfillGreen &myfillBrown & & & myfillBlue!30!Yellow& & & & & & & & & & & & & & & & & & & & & myfillBlue\
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,7) &myfillGreen & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw] at (3,4) & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture
    enddocument


    Output:



    enter image description here



    Edit: After OPS Edit:



    documentclass[12pt]article
    usepackageamsmath
    usepackageamsfonts

    usepackagetikz
    usetikzlibraryintersections,matrix

    newcommandmyfill[1]%This is the command manually adjusted to do the wholev job
    begintikzpicture[overlay, remember picture]
    draw[draw=none,fill=#1,shift=(-0.13,-0.13)](0,0)rectangle(0.255,0.26);
    endtikzpicture

    begindocument
    beginfigure
    resizebox textwidth !
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]

    border/.style=draw

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,10) myfillgreen& myfillred& & & & & & myfillbrown\
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,10) & & myfillyellow& & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,9) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,8) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,7) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (3,4) &myfillgreen & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,4) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,3) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,2) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,1) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector)[matrix of nodes, nodes=draw,ampersand replacement=&,] at (10,0) & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    draw [thick,->] (10.3,9.8) -- (10.3,9.2);
    node at(10.7,9.5) $oplus$;
    draw [thick,->] (10.3,8.8) -- (10.3,8.2);
    node at(10.7,8.5) $oplus$;
    draw [thick,->] (10.3,7.8) -- (10.3,7.2);
    node at(10.7,7.5) $T$;

    draw [thick,->] (10.3,3.8) -- (10.3,3.2);
    node at(10.7,3.5) $oplus$;
    draw [thick,->] (10.3,2.8) -- (10.3,2.2);
    node at(10.7,2.5) $oplus$;
    draw [thick,->] (10.3,1.8) -- (10.3,1.2);
    node at(10.7,1.5) $oplus$;
    draw [thick,->] (10.3,0.8) -- (10.3,0.2);
    node at(10.7,0.5) $T$;

    node at (0.5,10) $B_4^0leftarrowmathcalB_7,$$:;
    draw[thick,->] (4.5,10) -- node[above] $R_0$ (5.5,10);

    node at (3.5,9) $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,8) $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,7) $S'_127$:;

    node at (0.5,4) $B_5^0leftarrowmathcalB_3,b$:;
    draw[thick,->] (4.5,4) -- node[above] $R_7$ (5.5,4);

    node at (5.3,3) $S'_127$:;
    node at (3.8,2) $S_0,S_24,S_50,S_75,S_102$:;
    node at (1.7,1) $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node at (5.3,0) $S'_126$:;

    endtikzpicture

    endfigure
    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Sep 16 at 14:13

























    answered Sep 16 at 13:20









    koleygr

    9,9041735




    9,9041735











    • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
      – koleygr
      Sep 16 at 13:22










    • Updated answer colors with more accuracy.
      – koleygr
      Sep 16 at 13:30










    • Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
      – ikreb
      Sep 16 at 13:33










    • Thanks for your soultion!
      – ikreb
      Sep 16 at 13:33










    • @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
      – koleygr
      Sep 16 at 13:39
















    • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
      – koleygr
      Sep 16 at 13:22










    • Updated answer colors with more accuracy.
      – koleygr
      Sep 16 at 13:30










    • Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
      – ikreb
      Sep 16 at 13:33










    • Thanks for your soultion!
      – ikreb
      Sep 16 at 13:33










    • @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
      – koleygr
      Sep 16 at 13:39















    Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    Sep 16 at 13:22




    Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    Sep 16 at 13:22












    Updated answer colors with more accuracy.
    – koleygr
    Sep 16 at 13:30




    Updated answer colors with more accuracy.
    – koleygr
    Sep 16 at 13:30












    Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
    – ikreb
    Sep 16 at 13:33




    Sorry, I updated it. One question, whe does resizebox doesn't work with your solution? To ask a new question is not usefull or?
    – ikreb
    Sep 16 at 13:33












    Thanks for your soultion!
    – ikreb
    Sep 16 at 13:33




    Thanks for your soultion!
    – ikreb
    Sep 16 at 13:33












    @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
    – koleygr
    Sep 16 at 13:39




    @ikreb I think you can just edit your question with the change.. It's ok for me to select a better answer later that does both.
    – koleygr
    Sep 16 at 13:39










    up vote
    2
    down vote













    Here is an answer that makes use of resizebox. All you need to do is to put the tikzpicture in a lrbox. As for your real question, you only need to put |[fill=red]| in a given cell to fill the cell. I add some examples to the code.



    documentclass[12pt]article
    usepackageamsmath
    usepackageamsfonts

    usepackagetikz
    usetikzlibraryintersections,matrix,positioning
    newsaveboxpicbox
    begindocument
    beginfigure
    beginlrboxpicbox
    begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]
    border/.style=draw
    matrix(vector-1)[matrix of nodes, nodes=draw] [fill=red];
    matrix(vector-2)[right=2cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector-3)[below=1cm of vector-2,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector-4)[below=1cm of vector-3,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector-5)[below=1cm of vector-4,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;

    matrix(vector-6)[below=6.5cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & \
    ;
    matrix(vector-7)[right=2cm of vector-6,matrix of nodes, nodes=draw] [fill=yellow];
    matrix(vector-8)[below=1cm of vector-7,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector-9)[below=1cm of vector-8,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector-10)[below=1cm of vector-9,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    matrix(vector-11)[below=1cm of vector-10,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
    ;
    %
    foreach X [evaluate=X as Y using int(X-1)] in 3,4,8,9,10
    draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$oplus$;
    %
    foreach X [evaluate=X as Y using int(X-1)] in 5,11
    draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$T$;
    %
    draw[thick,-latex] (vector-1) -- (vector-2) node[midway,above]$R_0$;
    draw[thick,-latex] (vector-6) -- (vector-7) node[midway,above]$R_7$;
    %
    node[left=2mm of vector-1,anchor=east] $B_4^0leftarrowmathcalB_7,$$:;
    %
    node[left=2mm of vector-3,anchor=east] $S_127,S_0,S_24,S_50,S_75,S_102$:;
    node[left=2mm of vector-4,anchor=east] $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node[left=2mm of vector-5,anchor=east] $S'_127$:;
    %
    node[left=2mm of vector-6,anchor=east]$B_5^0leftarrowmathcalB_3,b$:;
    %
    node[left=2mm of vector-8,anchor=east] $S'_127$:;
    node[left=2mm of vector-9,anchor=east] $S_0,S_24,S_50,S_75,S_102$:;
    node[left=2mm of vector-10,anchor=east] $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
    node[left=2mm of vector-11,anchor=east] $S'_126$:;
    %
    endtikzpicture
    endlrbox
    resizeboxtextwidth!useboxpicbox
    endfigure
    enddocument


    enter image description here



    A word of caution: it is quite possible that someone may copy my code, add some feature like chains, and claim that this code then becomes much more "concise". I'd kindly ask you to check if this really the case. Your code is already very well structured and thus easy to understand and adjustable. I used used positioning because I think it is advantageous here, and also use foreach loops to repeat things. Personally I would refrain from using chains here for several reasons, one of them being that you lose some flexibility of adjusting positions. Likewise, you could define styles for repeating things, but your code is so well structured that I don't think that makes a big difference. So this is just to say that if someone claims to be more "concise" you should critically ask yourself if that's really true.






    share|improve this answer
























      up vote
      2
      down vote













      Here is an answer that makes use of resizebox. All you need to do is to put the tikzpicture in a lrbox. As for your real question, you only need to put |[fill=red]| in a given cell to fill the cell. I add some examples to the code.



      documentclass[12pt]article
      usepackageamsmath
      usepackageamsfonts

      usepackagetikz
      usetikzlibraryintersections,matrix,positioning
      newsaveboxpicbox
      begindocument
      beginfigure
      beginlrboxpicbox
      begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]
      border/.style=draw
      matrix(vector-1)[matrix of nodes, nodes=draw] [fill=red];
      matrix(vector-2)[right=2cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      matrix(vector-3)[below=1cm of vector-2,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      matrix(vector-4)[below=1cm of vector-3,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      matrix(vector-5)[below=1cm of vector-4,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;

      matrix(vector-6)[below=6.5cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & \
      ;
      matrix(vector-7)[right=2cm of vector-6,matrix of nodes, nodes=draw] [fill=yellow];
      matrix(vector-8)[below=1cm of vector-7,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      matrix(vector-9)[below=1cm of vector-8,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      matrix(vector-10)[below=1cm of vector-9,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      matrix(vector-11)[below=1cm of vector-10,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
      ;
      %
      foreach X [evaluate=X as Y using int(X-1)] in 3,4,8,9,10
      draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$oplus$;
      %
      foreach X [evaluate=X as Y using int(X-1)] in 5,11
      draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$T$;
      %
      draw[thick,-latex] (vector-1) -- (vector-2) node[midway,above]$R_0$;
      draw[thick,-latex] (vector-6) -- (vector-7) node[midway,above]$R_7$;
      %
      node[left=2mm of vector-1,anchor=east] $B_4^0leftarrowmathcalB_7,$$:;
      %
      node[left=2mm of vector-3,anchor=east] $S_127,S_0,S_24,S_50,S_75,S_102$:;
      node[left=2mm of vector-4,anchor=east] $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
      node[left=2mm of vector-5,anchor=east] $S'_127$:;
      %
      node[left=2mm of vector-6,anchor=east]$B_5^0leftarrowmathcalB_3,b$:;
      %
      node[left=2mm of vector-8,anchor=east] $S'_127$:;
      node[left=2mm of vector-9,anchor=east] $S_0,S_24,S_50,S_75,S_102$:;
      node[left=2mm of vector-10,anchor=east] $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
      node[left=2mm of vector-11,anchor=east] $S'_126$:;
      %
      endtikzpicture
      endlrbox
      resizeboxtextwidth!useboxpicbox
      endfigure
      enddocument


      enter image description here



      A word of caution: it is quite possible that someone may copy my code, add some feature like chains, and claim that this code then becomes much more "concise". I'd kindly ask you to check if this really the case. Your code is already very well structured and thus easy to understand and adjustable. I used used positioning because I think it is advantageous here, and also use foreach loops to repeat things. Personally I would refrain from using chains here for several reasons, one of them being that you lose some flexibility of adjusting positions. Likewise, you could define styles for repeating things, but your code is so well structured that I don't think that makes a big difference. So this is just to say that if someone claims to be more "concise" you should critically ask yourself if that's really true.






      share|improve this answer






















        up vote
        2
        down vote










        up vote
        2
        down vote









        Here is an answer that makes use of resizebox. All you need to do is to put the tikzpicture in a lrbox. As for your real question, you only need to put |[fill=red]| in a given cell to fill the cell. I add some examples to the code.



        documentclass[12pt]article
        usepackageamsmath
        usepackageamsfonts

        usepackagetikz
        usetikzlibraryintersections,matrix,positioning
        newsaveboxpicbox
        begindocument
        beginfigure
        beginlrboxpicbox
        begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]
        border/.style=draw
        matrix(vector-1)[matrix of nodes, nodes=draw] [fill=red];
        matrix(vector-2)[right=2cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-3)[below=1cm of vector-2,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-4)[below=1cm of vector-3,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-5)[below=1cm of vector-4,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;

        matrix(vector-6)[below=6.5cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & \
        ;
        matrix(vector-7)[right=2cm of vector-6,matrix of nodes, nodes=draw] [fill=yellow];
        matrix(vector-8)[below=1cm of vector-7,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-9)[below=1cm of vector-8,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-10)[below=1cm of vector-9,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-11)[below=1cm of vector-10,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        %
        foreach X [evaluate=X as Y using int(X-1)] in 3,4,8,9,10
        draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$oplus$;
        %
        foreach X [evaluate=X as Y using int(X-1)] in 5,11
        draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$T$;
        %
        draw[thick,-latex] (vector-1) -- (vector-2) node[midway,above]$R_0$;
        draw[thick,-latex] (vector-6) -- (vector-7) node[midway,above]$R_7$;
        %
        node[left=2mm of vector-1,anchor=east] $B_4^0leftarrowmathcalB_7,$$:;
        %
        node[left=2mm of vector-3,anchor=east] $S_127,S_0,S_24,S_50,S_75,S_102$:;
        node[left=2mm of vector-4,anchor=east] $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
        node[left=2mm of vector-5,anchor=east] $S'_127$:;
        %
        node[left=2mm of vector-6,anchor=east]$B_5^0leftarrowmathcalB_3,b$:;
        %
        node[left=2mm of vector-8,anchor=east] $S'_127$:;
        node[left=2mm of vector-9,anchor=east] $S_0,S_24,S_50,S_75,S_102$:;
        node[left=2mm of vector-10,anchor=east] $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
        node[left=2mm of vector-11,anchor=east] $S'_126$:;
        %
        endtikzpicture
        endlrbox
        resizeboxtextwidth!useboxpicbox
        endfigure
        enddocument


        enter image description here



        A word of caution: it is quite possible that someone may copy my code, add some feature like chains, and claim that this code then becomes much more "concise". I'd kindly ask you to check if this really the case. Your code is already very well structured and thus easy to understand and adjustable. I used used positioning because I think it is advantageous here, and also use foreach loops to repeat things. Personally I would refrain from using chains here for several reasons, one of them being that you lose some flexibility of adjusting positions. Likewise, you could define styles for repeating things, but your code is so well structured that I don't think that makes a big difference. So this is just to say that if someone claims to be more "concise" you should critically ask yourself if that's really true.






        share|improve this answer












        Here is an answer that makes use of resizebox. All you need to do is to put the tikzpicture in a lrbox. As for your real question, you only need to put |[fill=red]| in a given cell to fill the cell. I add some examples to the code.



        documentclass[12pt]article
        usepackageamsmath
        usepackageamsfonts

        usepackagetikz
        usetikzlibraryintersections,matrix,positioning
        newsaveboxpicbox
        begindocument
        beginfigure
        beginlrboxpicbox
        begintikzpicture [nodes in empty cells, nodes=minimum width=0.2cm, minimum height=0.2cm, row sep=-pgflinewidth, column sep=-pgflinewidth]
        border/.style=draw
        matrix(vector-1)[matrix of nodes, nodes=draw] [fill=red];
        matrix(vector-2)[right=2cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-3)[below=1cm of vector-2,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-4)[below=1cm of vector-3,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-5)[below=1cm of vector-4,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;

        matrix(vector-6)[below=6.5cm of vector-1,matrix of nodes, nodes=draw] & & & & & & & \
        ;
        matrix(vector-7)[right=2cm of vector-6,matrix of nodes, nodes=draw] [fill=yellow];
        matrix(vector-8)[below=1cm of vector-7,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-9)[below=1cm of vector-8,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-10)[below=1cm of vector-9,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        matrix(vector-11)[below=1cm of vector-10,matrix of nodes, nodes=draw] & & & & & & & & & & & & & & & & & & & & & & & & & & & & \
        ;
        %
        foreach X [evaluate=X as Y using int(X-1)] in 3,4,8,9,10
        draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$oplus$;
        %
        foreach X [evaluate=X as Y using int(X-1)] in 5,11
        draw[thick,-latex] (vector-Y) -- (vector-X) node[midway,right]$T$;
        %
        draw[thick,-latex] (vector-1) -- (vector-2) node[midway,above]$R_0$;
        draw[thick,-latex] (vector-6) -- (vector-7) node[midway,above]$R_7$;
        %
        node[left=2mm of vector-1,anchor=east] $B_4^0leftarrowmathcalB_7,$$:;
        %
        node[left=2mm of vector-3,anchor=east] $S_127,S_0,S_24,S_50,S_75,S_102$:;
        node[left=2mm of vector-4,anchor=east] $S_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
        node[left=2mm of vector-5,anchor=east] $S'_127$:;
        %
        node[left=2mm of vector-6,anchor=east]$B_5^0leftarrowmathcalB_3,b$:;
        %
        node[left=2mm of vector-8,anchor=east] $S'_127$:;
        node[left=2mm of vector-9,anchor=east] $S_0,S_24,S_50,S_75,S_102$:;
        node[left=2mm of vector-10,anchor=east] $S'_127oplus S_0oplus S_24oplus S_50oplus S_75oplus S_102oplus R_0(B_0^0)$:;
        node[left=2mm of vector-11,anchor=east] $S'_126$:;
        %
        endtikzpicture
        endlrbox
        resizeboxtextwidth!useboxpicbox
        endfigure
        enddocument


        enter image description here



        A word of caution: it is quite possible that someone may copy my code, add some feature like chains, and claim that this code then becomes much more "concise". I'd kindly ask you to check if this really the case. Your code is already very well structured and thus easy to understand and adjustable. I used used positioning because I think it is advantageous here, and also use foreach loops to repeat things. Personally I would refrain from using chains here for several reasons, one of them being that you lose some flexibility of adjusting positions. Likewise, you could define styles for repeating things, but your code is so well structured that I don't think that makes a big difference. So this is just to say that if someone claims to be more "concise" you should critically ask yourself if that's really true.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 16 at 15:01









        marmot

        61.8k466134




        61.8k466134



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451104%2ftikzpicture-how-to-color-separate-fields-at-the-arrays-and-use-resizebox%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)