LaTeX 中带有百叶窗平面的立方体

LaTeX 中带有百叶窗平面的立方体

我有一段代码,可以生成下图:

\documentclass{article}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{shapes,shadows,positioning,arrows,calc,matrix,decorations.markings,decorations.pathreplacing}

\begin{document}

\definecolor{colone}{RGB}{209,220,204}
\definecolor{coltwo}{RGB}{204,222,210}
\definecolor{colthree}{RGB}{207,233,232}
\definecolor{colfour}{RGB}{248,243,214}
\definecolor{colfive}{RGB}{245,238,197}
\definecolor{colsix}{RGB}{243,235,179}
\definecolor{colseven}{RGB}{241,231,163}
\definecolor{colortop}{RGB}{184,223,155}
\definecolor{colorside}{RGB}{0,209,54}

\begin{figure}[H]
\begin{tikzpicture}[every node/.style={minimum size=1cm,font=\scriptsize},on grid]
\begin{scope}[every node/.append style={yslant=-0.5},yslant=-0.5]
  \shade[right color=colorside!30, left color=colorside!50] (-1,0) rectangle +(4,3);
  \node  at (-0.5,2.25) {};
  \node at (0.5,2.75) {$Sex$};
  \node at (1.5,2.75) {$Age$};
  \node at (2.5,2.75) {$Area$};
  \node at (-0.5,1.25) {$User_3$};
  \node at (-0.5,0.75) {$...$};
  \node at (0.5,0.75) {$...$};
  \node at (2.5,0.75) {$...$};
  \node at (0.5,1.25) {$*$};
  \node at (1.5,1.25) {$4$};
   \node at (2.5,1.25) {$0$};
   \node at (-0.5,0.25) {$User_n$};
   \node at (1.5,0.75) {$...$};
   \node at (-0.5,2.25) {$user_1$};
   \node at (0.5,2.25) {$0$};
   \node at (1.5,2.25) {$*$};
   \node at (2.5,2.25) {$1$};
    \node at (-0.5,1.75) {$User_2$};
    \node at (0.5,1.75) {$1$};
    \node at (1.5,1.75) {$3$};
    \node at (2.5,1.75) {$0$};
    \node at (0.5,0.25) {$2$};
    \node at (1.5,0.25) {$*$};
    \node at (2.5,0.25) {$9$};
  \draw (-1,0) grid[ystep=0.5] (3,3);
\end{scope}
\begin{scope}[every node/.append style={yslant=0.5},yslant=0.5]
  \shade[right color=colorside!70,left color=colorside!10] (3,-3) rectangle +(5,3);
  \node at (3.5,-0.25) {};
  \node at (3.5,-0.75) {$user_1$};
  \node at (3.5,-1.25) {$user_2$};
  \node at (3.5,-1.75){$user_3$};
  \node at (3.5,-2.25) {$...$};
  \node at (3.5,-2.75) {$user_n$};
  \node at (4.5,-0.25) {$item_1$};
  \node at (4.5,-1.25) {$3$};
  \node at (4.5,-0.75) {$*$};
  \node at (4.5,-1.75) {$*$};
  \node at (4.5,-2.25) {$...$};
  \node at (4.5,-2.75) {$*$};
  \node at (5.5,-0.25) {$item_2$};
  \node at (5.5,-0.75) {$2$};
  \node at (5.5,-1.75) {$3$};
  \node at (5.5,-1.25) {$4$};
   \node at (5.5,-2.75) {$5$};
  \node at (5.5,-2.25) {$...$};
  \node at (6.5,-0.25) {$...$};
  \node at (6.5,-1.25) {$...$};
  \node at (6.5,-2.25) {$...$};
  \node at (6.5,-0.75) {$...$};
  \node at (6.5,-1.75) {$...$};
  \node at (6.5,-2.75) {$...$};
  \node at (7.5,-0.25) {$item_n$};
  \node at (7.5,-0.75) {$3$};
  \node at (7.5,-1.25) {$5$};
  \node at (7.5,-1.75) {$4$};
  \node at (7.5,-2.25) {$...$};
  \node at (7.5,-2.75) {$*$};





  \draw (3,-3) grid[ystep=0.5] (8,0);
 \end{scope}
\begin{scope}[every node/.append style={
    yslant=0.5,xslant=-1},yslant=0.5,xslant=-0.75
  ]
  \shade[bottom color=colortop!10, top color=colortop!80] (8,4) rectangle +(-5,-4);
\draw (3.0,0.0) grid[ystep=0.5] (8,4);
 \node at (3.5,3.75) {};
 \node at (3.5,3.25) {$Legal$};
 \node at (3.5,2.75) {$Fin.$};
 \node at (3.5,2.25) {$Med.$};
 \node at (3.5,1.75) {$Home$};
 \node at (3.5,1.25) {$Road$};
 \node at (3.5,0.75) {$Travel$};
  \node at (3.5,0.25) {$Din.$};
 \node at (4.5,3.75) {$item_1$};
  \node at (4.5,3.25) {$1$};
 \node at (4.5,2.75) {$0$};
 \node at (4.5,2.25) {$0$};
 \node at (4.5,1.75) {$1$};
 \node at (4.5,1.25) {$1$};
 \node at (4.5,0.75) {$0$};
 \node at (4.5,0.25) {$1$};
\node at (5.5,3.75) {$item_2$};
  \node at (5.5,3.25) {$1$};
  \node at (5.5,2.75) {$0$};
  \node at (5.5,2.25) {$0$};
  \node at (5.5,1.75) {$1$};
  \node at (5.5,1.25) {$0$};
  \node at (5.5,0.75) {$1$};
  \node at (5.5,0.25) {$1$};
 \node at (6.5,3.75) {$...$};
\node at (6.5,3.25) {$...$};
\node at (6.5,2.75) {$...$};
\node at (6.5,2.25) {$...$};
\node at (6.5,1.75) {$...$};
\node at (6.5,1.25) {$...$};
\node at (6.5,0.75) {$...$};
\node at (6.5,0.25) {$...$};
\node at (7.5,3.75) {$item_n$};
\node at (7.5,3.25) {$0$};
\node at (7.5,2.75) {$1$};
\node at (7.5,2.25) {$1$};
\node at (7.5,1.75) {$0$};
\node at (7.5,1.25) {$0$};
\node at (7.5,0.75) {$1$};
\node at (7.5,0.25) {$0$};


\end{scope}
\end{tikzpicture}
 \caption{User-Item Combined Matrix}
\label{fig:com}
\end{figure}
\end{document}

百叶立方体

我想做以下事情:

  1. 以一定角度打开右侧平面,以显示与左侧平面类似的数据
  2. 以与顶部平面相同的方式打开底部平面。
  3. 如果可能的话,每个平面使用不同的颜色。

相关内容