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
    6 mins ago














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
    6 mins ago












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 18 mins ago

























asked 1 hour ago









ikreb

1876




1876











  • Your editid code doesn't compile for some reason... Please fix your preamble.
    – koleygr
    6 mins ago
















  • Your editid code doesn't compile for some reason... Please fix your preamble.
    – koleygr
    6 mins ago















Your editid code doesn't compile for some reason... Please fix your preamble.
– koleygr
6 mins ago




Your editid code doesn't compile for some reason... Please fix your preamble.
– koleygr
6 mins ago










2 Answers
2






active

oldest

votes

















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






share|improve this answer






















  • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    45 mins ago










  • Updated answer colors with more accuracy.
    – koleygr
    36 mins ago










  • 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
    34 mins ago










  • Thanks for your soultion!
    – ikreb
    34 mins ago










  • @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
    28 mins ago

















up vote
2
down vote













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
    42 mins ago











  • 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
    41 mins ago










  • @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    14 mins ago










  • @ikreb, see edited answer!
    – Zarko
    13 mins ago










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






























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








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






share|improve this answer






















  • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    45 mins ago










  • Updated answer colors with more accuracy.
    – koleygr
    36 mins ago










  • 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
    34 mins ago










  • Thanks for your soultion!
    – ikreb
    34 mins ago










  • @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
    28 mins ago














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






share|improve this answer






















  • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    45 mins ago










  • Updated answer colors with more accuracy.
    – koleygr
    36 mins ago










  • 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
    34 mins ago










  • Thanks for your soultion!
    – ikreb
    34 mins ago










  • @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
    28 mins ago












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






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







share|improve this answer














share|improve this answer



share|improve this answer








edited 29 mins ago

























answered 46 mins ago









koleygr

9,6151634




9,6151634











  • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    45 mins ago










  • Updated answer colors with more accuracy.
    – koleygr
    36 mins ago










  • 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
    34 mins ago










  • Thanks for your soultion!
    – ikreb
    34 mins ago










  • @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
    28 mins ago
















  • Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
    – koleygr
    45 mins ago










  • Updated answer colors with more accuracy.
    – koleygr
    36 mins ago










  • 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
    34 mins ago










  • Thanks for your soultion!
    – ikreb
    34 mins ago










  • @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
    28 mins ago















Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
– koleygr
45 mins ago




Also, please next time post a compilable MWE. (No documentclass and begindocument was there).
– koleygr
45 mins ago












Updated answer colors with more accuracy.
– koleygr
36 mins ago




Updated answer colors with more accuracy.
– koleygr
36 mins ago












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
34 mins ago




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
34 mins ago












Thanks for your soultion!
– ikreb
34 mins ago




Thanks for your soultion!
– ikreb
34 mins ago












@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
28 mins ago




@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
28 mins ago










up vote
2
down vote













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
    42 mins ago











  • 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
    41 mins ago










  • @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    14 mins ago










  • @ikreb, see edited answer!
    – Zarko
    13 mins ago














up vote
2
down vote













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
    42 mins ago











  • 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
    41 mins ago










  • @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    14 mins ago










  • @ikreb, see edited answer!
    – Zarko
    13 mins ago












up vote
2
down vote










up vote
2
down vote









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 16 mins ago

























answered 43 mins ago









Zarko

112k861150




112k861150











  • 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
    42 mins ago











  • 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
    41 mins ago










  • @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    14 mins ago










  • @ikreb, see edited answer!
    – Zarko
    13 mins ago
















  • 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
    42 mins ago











  • 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
    41 mins ago










  • @koleygr, permanently you win in guessing! congratulation and +1!
    – Zarko
    14 mins ago










  • @ikreb, see edited answer!
    – Zarko
    13 mins ago















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
42 mins ago





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
42 mins ago













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
41 mins ago




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
41 mins ago












@koleygr, permanently you win in guessing! congratulation and +1!
– Zarko
14 mins ago




@koleygr, permanently you win in guessing! congratulation and +1!
– Zarko
14 mins ago












@ikreb, see edited answer!
– Zarko
13 mins ago




@ikreb, see edited answer!
– Zarko
13 mins ago

















 

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













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

Confectionery