Matrix with effects

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,shadows.blur,positioning,decorations.pathreplacing}

\begin{document}
\begin{tikzpicture}[,decoration={brace,mirror,raise=0.1em}]
\matrix (A) [matrix of math nodes, nodes in empty cells,inner sep=0pt,
nodes={draw, minimum width=12mm, minimum height=12mm, outer sep=0pt, 
anchor=center},row sep=-\pgflinewidth, column sep=-\pgflinewidth,
row 1/.style = {nodes={minimum height=8mm}},
row 3/.style = {nodes={minimum height=8mm,fill=lightgray}},
row 5/.style = {nodes={minimum height=8mm}},
column 1/.style = {nodes={minimum width=8mm}},
column 3/.style = {nodes={minimum width=8mm,fill=lightgray}},
column 5/.style = {nodes={minimum width=8mm}},
fill=white,blur shadow]
{   r_{11} & & r_{1g} & & r_{1n}\\
    & &  & & \\
     r_{i1} & & |[fill=black,text=white]| r_{ig} & & r_{in}\\
    & &  & & \\
     r_{m1} & & r_{mg} & & r_{mn}\\
     };
\foreach \X/\Y in {1/1,3/g,5/n}
 {\node[above=0.2em of A-1-\X] (T-\X) {$\Y$};}
\foreach \X/\Y in {1/1,3/i,5/m}
 {\node[left=0.2em of A-\X-1] (L-\X) {$\Y$};}
\draw[decorate] (T-3.south-|A.east) -- (T-3.north-|A.east)
 node[midway,right=0.1em] {$G$};
\draw[decorate] (A-3-5.south-|A.east) -- (A-3-5.north-|A.east)
 node[midway,right=0.1em] {$R_i$};
\draw[decorate] (L-5.west|-A.south) --
 (L-5.east|-A.south) node[midway,below=0.1em] {$I$};
\draw[decorate] (A-5-3.west|-A.south) --
 (A-5-3.east|-A.south) node[midway,below=0.1em] {$R_g$};
\node[above=0.2em of T-3] {items};
\node[left=0.2em of L-3] {users};
\end{tikzpicture}
\end{document}

enter image description here

Blue shadow a la percusse's deleted answer.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,shadows.blur,positioning,decorations.pathreplacing}
\makeatletter
\tikzset{render blur shadow/.code={\pgfbs@savebb%
\pgfsyssoftpath@getcurrentpath{\pgfbs@input@path}%
\pgfbs@compute@shadow@bbox%
\pgfbs@process@rounding{\pgfbs@input@path}{\pgfbs@fadepath}%
\pgfbs@apply@canvas@transform%
\colorlet{pstb@shadow@color}{white!\pgfbs@opacity!#1}%
\pgfdeclarefading{shadowfading}{\pgfbs@paint@fading}%
\pgfsetfillcolor{#1}%
\pgfsetfading{shadowfading}{\pgftransformshift{\pgfpoint{\pgfbs@midx}{\pgfbs@midy}}}%
\pgfbs@usebbox{fill}%
\pgfbs@restorebb%
},render blur shadow/.default=shadowcolor}
\colorlet{shadowcolor}{black}
\makeatother
\begin{document}
\begin{tikzpicture}[,decoration={brace,mirror,raise=0.3em}]
\colorlet{shadowcolor}{blue}
\matrix (A) [matrix of math nodes, nodes in empty cells,inner sep=0pt,
nodes={draw, minimum width=12mm, minimum height=12mm, outer sep=0pt, 
anchor=center},row sep=-\pgflinewidth, column sep=-\pgflinewidth,
row 1/.style = {nodes={minimum height=8mm}},
row 3/.style = {nodes={minimum height=8mm,fill=lightgray}},
row 5/.style = {nodes={minimum height=8mm}},
column 1/.style = {nodes={minimum width=8mm}},
column 3/.style = {nodes={minimum width=8mm,fill=lightgray}},
column 5/.style = {nodes={minimum width=8mm}},
fill=white,blur shadow={shadow blur steps=10,shadow xshift=0.3em,shadow
yshift=-0.3em,shadow blur radius=1.5ex}]
{   r_{11} & & r_{1g} & & r_{1n}\\
    & &  & & \\
     r_{i1} & & |[fill=black,text=white]| r_{ig} & & r_{in}\\
    & &  & & \\
     r_{m1} & & r_{mg} & & r_{mn}\\
     };
\foreach \X/\Y in {1/1,3/g,5/n}
 {\node[above=0.2em of A-1-\X] (T-\X) {$\Y$};}
\foreach \X/\Y in {1/1,3/i,5/m}
 {\node[left=0.2em of A-\X-1] (L-\X) {$\Y$};}
\draw[decorate] (T-3.south-|A.east) -- (T-3.north-|A.east)
 node[midway,right=0.3em] {$G$};
\draw[decorate] (A-3-5.south-|A.east) -- (A-3-5.north-|A.east)
 node[midway,right=0.3em] {$R_i$};
\draw[decorate] (L-5.west|-A.south) --
 (L-5.east|-A.south) node[midway,below=0.3em] {$I$};
\draw[decorate] (A-5-3.west|-A.south) --
 (A-5-3.east|-A.south) node[midway,below=0.3em] {$R_g$};
\node[above=0.2em of T-3] {items};
\node[left=0.2em of L-3] {users};
\end{tikzpicture}
\end{document}

enter image description here


I think this should get you going:

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}
\begin{tikzpicture}
\draw[fill=gray!40, opacity=0.8] (-4,1) rectangle (-1.5,0);
\draw[fill=gray!40, opacity=0.8] (-0.5,1) rectangle (2.5,0);
\draw[fill=gray!40, opacity=0.8] (-1.5,0) rectangle (-0.5,-3);
\draw[fill=gray!40, opacity=0.8] (-1.5,4) rectangle (-0.5,1);
\draw (-4,4) rectangle (-3,-3);
\draw (-3,4) rectangle (-1.5,-3);
\draw (-0.5,4) rectangle (1.5,-3);
\draw (1.5,4) rectangle (2.5,-3);
\draw (-4,4) rectangle (2.5,3);
\draw (-4,-3) rectangle (2.5,-2);
\draw[fill=black]  (-1.5,1) rectangle (-0.5,0);
\node at (-1,0.5) {\textcolor{white}{$r_{ig}$}};
\node at (-3.5,3.5) {$r_{11}$};
\node at (-3.5,0.5) {$r_{i1}$};
\node at (-1,3.5) {$r_{1g}$};
\node at (-3.5,-2.5) {$r_{m1}$};
\draw[decorate, decoration={brace, amplitude=3pt}] (2.6,1.0) -- (2.6,0);
\node at (3,0.5) {$R_i$}
\end{tikzpicture}
\end{document}

result

Tags:

Tikz Pgf