A beneficio di chi avesse bisogno, per colorare invece soltanto lo sfondo di alcuni elementi ho utilizzato questo codice (sempre seguendo il metodo con pgfonlayer):
`
\begin{tikzpicture}
\tikzset{myfillcolor/.style = {opacity=.4,circle, fill=#1, draw=none}}
\matrix[matrix of math nodes,left delimiter=(,right delimiter=)]
{
\node(h) {0}; & \node(q){0.4};& \node {0.2}; & \node(a){0.4}; \\
\node {0.2}; & \node(w){0.4};& \node {0}; & \node(b){0.2}; \\
\node {0.4}; & \node(r){0.2}; &\node(t) {0.4}; & \node(c){0.2}; \\
\node(g) {0.2}; & \node(f){0};& \node(e) {0.2}; & \node(d){0.4}; \\
};
%——————————————————-
\begin{pgfonlayer}{background}
\foreach \x in {q,w,r,t,d}
\draw[myfillcolor=red!45] (\x.south west)rectangle (\x.north east);
\end{pgfonlayer}
%——————————————————-
\foreach \x/\xtext in {a/1,b/0.8,c/1,d/0.8}
\node[shift=(\x.east),xshift=0.75cm](0,0) {\xtext} ;
%——————————————————-
\foreach \x/\xtext in {g/0.8,f/1,e/0.8,d/1}
\node[shift=(\x.south),yshift=-0.45cm](0,0) {\xtext} ;
\end{tikzpicture}
`
Il risultato grafico è:
[attachment=97]matrix.jpg[/attachment]