figure-tensor-sample.tex 1.79 KB
Newer Older
孟霞 committed
1 2 3 4 5 6 7 8 9
%%%------------------------------------------------------------------------------------------------------------
\newcounter{mycount1}
\newcounter{mycount2}
\newcounter{mycount3}
\newcounter{mycount4}

\begin{tikzpicture}
\begin{scope}[yshift=6.5em,xshift=1em]
\setcounter{mycount1}{1}
孟霞 committed
10
\draw[step=0.5cm,color=orange!70,line width=0.4mm] (-2,-2) grid (1,1);
孟霞 committed
11 12
\foreach \y in {+0.5,-0.5,-1.5}
  \foreach \x in {-1.5,-0.5,0.5}{
孟霞 committed
13
    \node [fill=orange!15,inner sep=0pt,minimum height=0.98cm,minimum width=0.98cm] at (\x,\y) {\number\value{mycount1}};
孟霞 committed
14 15 16 17
    \addtocounter{mycount1}{1};
  }
\end{scope}

孟霞 committed
18
\begin{scope}[yshift=5em,xshift=-0.5em]
孟霞 committed
19
\setcounter{mycount2}{2}
孟霞 committed
20
\draw[step=0.5cm,color=blue!70,line width=0.4mm] (-2,-2) grid (1,1);
孟霞 committed
21 22
\foreach \y in {+0.5,-0.5,-1.5}
  \foreach \x in {-1.5,-0.5,0.5}{
孟霞 committed
23
    \node [fill=blue!15,inner sep=0pt,minimum height=0.98cm,minimum width=0.98cm] at (\x,\y) {\number\value{mycount2}};
孟霞 committed
24 25 26 27
    \addtocounter{mycount2}{1};
  }
\end{scope}

孟霞 committed
28
\begin{scope}[yshift=3.5em,xshift=-2em]
孟霞 committed
29
\setcounter{mycount3}{3}
孟霞 committed
30
\draw[step=0.5cm,color=ugreen!70,line width=0.4mm] (-2,-2) grid (1,1);
孟霞 committed
31 32
\foreach \y in {+0.5,-0.5,-1.5}
  \foreach \x in {-1.5,-0.5,0.5}{
孟霞 committed
33
    \node [fill=ugreen!15,inner sep=0pt,minimum height=0.98cm,minimum width=0.98cm] at (\x,\y) {\number\value{mycount3}};
孟霞 committed
34 35 36 37
    \addtocounter{mycount3}{1};
  }
\end{scope}

孟霞 committed
38
\begin{scope}[yshift=2em,xshift=-3.5em]
孟霞 committed
39
\setcounter{mycount4}{4}
孟霞 committed
40
\draw[step=0.5cm,color=red!70,line width=0.4mm] (-2,-2) grid (1,1);
孟霞 committed
41 42
\foreach \y in {+0.5,-0.5,-1.5}
  \foreach \x in {-1.5,-0.5,0.5}{
孟霞 committed
43
    \node [fill=red!15,inner sep=0pt,minimum height=0.98cm,minimum width=0.98cm] at (\x,\y) {\number\value{mycount4}};
孟霞 committed
44 45 46 47
    \addtocounter{mycount4}{1};
  }
\end{scope}
\end{tikzpicture}
xiaotong committed
48
%%%------------------------------------------------------------------------------------------------------------